Files
SublerMKV/Utilities/ParseFilename/ParseFilename.pl
T
Scott GarrettandClaude Code f20ad7ee45 Search metadata directly from IDs embedded in file names
ParseFilename's movie-IMDB pattern now recognizes parenthesized years and
brace-wrapped service IDs, so names like "Movie (2024) {tmdb-1015812}" no
longer truncate to "Movie (2024) {tmdb". The ID kind is captured (imdb,
tmdb, tvdb, tt; IDs widened to 7-9 digits for modern IMDb IDs) and
emitted as an "id:<kind>:<value>" line.

Parsed IDs ride along in MetadataSearchTerms.movie as a MetadataFileID.
TheMovieDB answers direct lookups (movie/{id} for TMDb IDs, find +
external_source=imdb_id for IMDb IDs) as a movieIDSearch; the search
sheet, the queue metadata action, and the AppleScript fetch-metadata
command try the direct lookup first and fall back to the title search
when the ID is unknown or the provider doesn't support it. Index-based
AppleScript result commands keep the name search by design.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-28 13:10:25 -05:00

32 lines
697 B
Perl
Executable File

#!/usr/bin/perl
use Video::Filename;
my $filename = $ARGV[0];
my $file = Video::Filename::new($filename);
if ($file->isTVshow()) {
print "tv" . "\n";
print $file->{name} . "\n";
print $file->{season} . "\n";
print $file->{episode} . "\n";
} elsif ($file->isEpisode()) {
print "tv" . "\n";
print $file->{name} . "\n";
print $file->{season} . "\n";
print $file->{episode} . "\n";
print $file->{part} . "\n";
} elsif ($file->isMovie()) {
print "movie" . "\n";
print $file->{movie} . "\n";
if (defined $file->{imdb}) {
my $idkind = defined $file->{idkind} ? $file->{idkind} : "";
print "id:" . $idkind . ":" . $file->{imdb} . "\n";
}
} else {
print "unknown" . "\n";
}
exit;