diff options
author | 2014-08-10 23:48:06 +0000 | |
---|---|---|
committer | 2014-08-10 23:48:06 +0000 | |
commit | 2d5fc71ad69f8f009264d2520e1857ff4199b793 (patch) | |
tree | 8aaf71a9af7fc9716ca0b9e8e207e9c2518a4501 | |
parent | c60c50a6015d1b678a537578bd93b1808a894e45 (diff) |
always set the playcount to some numeric value, 0 if we fail
-rw-r--r-- | doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl b/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl index 1fa7f0baa..76ad33649 100644 --- a/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl +++ b/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl @@ -7,6 +7,10 @@ my @lines = `echo 'SELECT playCount, path.strPath, files.strFileName FROM movie for (@lines) { my ($count, $dir, $file) = split /\|/; chomp $file; + # empty or non-numeric count is zero + if ($count !~ /[0-9]/) { + $count = 0; + } $dir =~ s/$prefix//; if ($file =~ s#stack://##) { for (split /,/, $file) { |