trying script upload from the web interface, neat
This commit is contained in:
		
					parent
					
						
							
								ae30cba464
							
						
					
				
			
			
				commit
				
					
						fd2546dafb
					
				
			
		
					 1 changed files with 24 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
#! /usr/bin/perl -w
 | 
			
		||||
 | 
			
		||||
my $dbpath="/home/video/.xbmc/userdata/Database/MyVideos75.db";
 | 
			
		||||
my $prefix="/home/media/video/";
 | 
			
		||||
 | 
			
		||||
my @lines = `echo 'SELECT playCount, path.strPath, files.strFileName FROM movie JOIN files ON files.idFile=movie.idFile JOIN path ON path.idPath=files.idPath;' | sqlite3 $dbpath`;
 | 
			
		||||
for (@lines) {
 | 
			
		||||
    my ($count, $dir, $file) = split /\|/;
 | 
			
		||||
    chomp $file;
 | 
			
		||||
    $dir =~ s/$prefix//;
 | 
			
		||||
    if ($file =~ s#stack://##) {
 | 
			
		||||
        for (split /,/, $file) {
 | 
			
		||||
            s/$prefix//;
 | 
			
		||||
            s/^ //;
 | 
			
		||||
            s/ $//;
 | 
			
		||||
            my @cmd = (qw(git annex metadata --set), "playCount=$count", $_);
 | 
			
		||||
            system(@cmd);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        my @cmd = (qw(git annex metadata --set), "playCount=$count", "$dir$file");
 | 
			
		||||
        system(@cmd);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue