Local Content: Scan Sources Ignored

Please post some examples of filenames and paths that you are having trouble with.

Below are some examples of imported data and the results. My files are named slug-style and such that directories list them in airdate episode order. (The latter is accomplished by placing original airdate prior to SxxExx.) For Channels purposes, I symlink an appropriately named file for its consumption:

src: /var/content/Rewinds/csi-miami-20040202-s02e13-blood-moon.m3u
dst: /var/content/Imports/TV/csi-miami/csi-miami-20040202-s02e13-blood-moon.mp4
dst: /var/content/Imports/TV/csi-miami/csi miami 20040202 s02e13 blood moon.mp4
dst: /var/content/Imports/TV/csi-miami/csi miami 20040202 S02E13 blood moon.mp4
dst: /var/content/Imports/TV/csi-miami/csi miami 20040202 S02E13 blood moon.mp4
dst: /var/content/Imports/TV/csi-miami/Csi Miami 20040202 S02E13 Blood Moon.mp4
dst: /var/content/Imports/TV/csi-miami/Csi Miami 2004-02-02 S02E13 Blood Moon.mp4

Every Variation Correctly Identified:
CSI: Miami Blood Moon: Season 2, Episode 13
Horatio suspects revenge is behind the murder of a man who tortured Cuban refugees.

Below is the Channels metadata for the import. All information matches what was provided-- Title (CSI Miami), Episode Title (Blood Moon), OriginalDate (2004-02-02) Season Number (2), Episode Number (13).

{"ID":"577", "GroupID":"184820", "Path":"csi-miami/Csi Miami 2004-02-02 S02E13 Blood Moon.mp4", "CreatedAt":1630510683,"Duration":5,"Completed":true,"Processed":true,"Airing":{"Source":"tms", "OriginalDate":"2004-02-02", "Time":1075680000,"Duration":0,"Title":"CSI: Miami", "EpisodeTitle":"Blood Moon", "Summary":"Horatio suspects revenge is behind the murder of a man who tortured Cuban refugees.", "FullSummary":"Horatio suspects revenge is behind the murder of a man who tortured Cuban refugees.", "Categories":["Episode", "Series"],"Genres":["Crime drama", "Action", "Thriller", "Mystery"],"Tags":["HD", "Stereo"],"SeriesID":"184820", "ProgramID":"EP005240610037", "SeasonNumber":2,"EpisodeNumber":13,"Directors":["Scott Lautanen"],"Cast":["David Caruso", "Emily Procter", "Rory Cochrane"],"ReleaseYear":2004,"Raw":{"startTime":"2004-02-02T00:00Z", "endTime":"", "duration":0,"channels":null,"stationId":"", "qualifiers":null,"ratings":null,"program":{"tmsId":"EP005240610037", "rootId":"2722934", "seriesId":"184820", "entityType":"Episode", "subType":"Series", "title":"CSI: Miami", "titleLang":"en", "episodeTitle":"Blood Moon", "episodeNum":13,"seasonNum":2,"releaseYear":2004,"releaseDate":"2004-02-02", "origAirDate":"2004-02-02", "descriptionLang":"en", "shortDescription":"Horatio suspects revenge is behind the murder of a man who tortured Cuban refugees.", "longDescription":"Horatio suspects revenge is behind the murder of a man who tortured Cuban refugees.", "topCast":["David Caruso", "Emily Procter", "Rory Cochrane"],"directors":["Scott Lautanen"],"genres":["Crime drama", "Action", "Thriller", "Mystery"], "runTime":"PT00H44M"}}},"UpdatedAt":1630510683280,"ImportPath":"Imports/TV", "ImportQuery":"csi-miami", "ImportGroup":"184820", "ImportedAt":1630510683091}

src: /var/content/Rewinds/csi-miami-20040209-s02e16-slow-burn.m3u
dst: /var/content/Imports/TV/csi-miami/csi-miami-20040209-s02e16-slow-burn.mp4
dst: /var/content/Imports/TV/csi-miami/csi miami 20040209 s02e16 slow burn.mp4
dst: /var/content/Imports/TV/csi-miami/csi miami 20040209 S02E16 slow burn.mp4
dst: /var/content/Imports/TV/csi-miami/Csi Miami 20040209 S02E16 Slow Burn.mp4
dst: /var/content/Imports/TV/csi-miami/Csi Miami 2004-02-09 S02E16 Slow Burn.mp4

Every Variation Incorrectly Identified:
CSI: Miami Invasion: Season 2, Episode 16
A former surf champion is murdered in his home, while his wife and son are left beaten and bound.
Incorrect Identification (Invasion was production episode 16, Slow Burn was airdate episode 16)
(This was episode 14 by airdate and episode 16 by production date)

The identification code seems to exclusively use SxxExx for episode identification. Because different content providers (via their epg data) and different metadate providers (Gracenote, etc) don't have a standardized definition of SxxExx, you encounter a mismatch possibility anytime the episode number based on airdate vs production date differ.

Using original airdate and/or episode title avoids the issue because those are both precisely defined values with little room for individual interpretation. Am certain there is some bad data associated with those, but that is different than using an ambiguously defined field. Below is the metadata for the wrongly identified episode. It is absolutely obvious its wrong as both the episode title and original airdate are incorrect.

{"ID":"576", "GroupID":"184820", "Path":"csi-miami/Csi Miami 2004-02-09 S02E16 Slow Burn.mp4", "CreatedAt":1630510648,"Duration":5,"Completed":true,"Processed":true,"Airing":{"Source":"tms", "OriginalDate":"2004-02-23", "Time":1077494400,"Duration":0,"Title":"CSI: Miami", "EpisodeTitle":"Invasion", "Summary":"A former surf champion is murdered in his home, while his wife and son are left beaten and bound.", "FullSummary":"A former surf champion is murdered in his home, while his wife and son are left beaten and bound.", "Categories":["Episode", "Series"],"Genres":["Crime drama", "Action", "Thriller", "Mystery"],"Tags":["HD", "Stereo"],"SeriesID":"184820", "ProgramID":"EP005240610040", "SeasonNumber":2,"EpisodeNumber":16,"Directors":["Felix Alcala"],"Cast":["David Caruso", "Emily Procter", "Rory Cochrane"],"ReleaseYear":2004,"Raw":{"startTime":"2004-02-23T00:00Z", "endTime":"", "duration":0,"channels":null,"stationId":"", "qualifiers":null,"ratings":null,"program":{"tmsId":"EP005240610040", "rootId":"2722937", "seriesId":"184820", "entityType":"Episode", "subType":"Series", "title":"CSI: Miami", "titleLang":"en", "episodeTitle":"Invasion", "episodeNum":16,"seasonNum":2,"releaseYear":2004,"releaseDate":"2004-02-23", "origAirDate":"2004-02-23", "descriptionLang":"en", "shortDescription":"A former surf champion is murdered in his home, while his wife and son are left beaten and bound.", "longDescription":"A former surf champion is murdered in his home, while his wife and son are left beaten and bound.", "topCast":["David Caruso", "Emily Procter", "Rory Cochrane"],"directors":["Felix Alcala"],"genres":["Crime drama", "Action", "Thriller", "Mystery"], "runTime":"PT00H45M"}}}, "UpdatedAt":1630510648642,"ImportPath":"Imports/TV", "ImportQuery":"csi-miami", "ImportGroup":"184820", "ImportedAt":1630510648418}

Below is a movie import example and demonstrates a parser issue. Whereas TV allows whitespace and some set of symbols between words, the movie year parser looks exclusively for whitespace immediately prior (but the rest of the name can use symbols). Believe the year must be in parenthesis to be recognized, but my testing was limited.

src: /var/content/Rewinds/hallmark-1989-the-shell-seekers.m3u
dst: /var/content/Imports/Movies/hallmark/the-shell-seekers-1989.mp4
dst: /var/content/Imports/Movies/hallmark/the-shell-seekers-(1989).mp4
dst: /var/content/Imports/Movies/hallmark/the shell seekers-(1989).mp4
Unable to identify (First choice of Fix Incorrect Match is correct)

dst: /var/content/Imports/Movies/hallmark/the-shell-seekers (1989).mp4
dst: /var/content/Imports/Movies/hallmark/the shell seekers (1989).mp4
dst: /var/content/Imports/Movies/hallmark/The Shell Seekers (1989).mp4
Correctly identified

Unfortunately, no amount of fancy renaming can work around the TV Exx issue. Seems like the fix is easy-- use the season from Sxx but start with the episode title. If no match within the season, try the original airdate. If no match, fall back to Exx and no worse off than today. There will still be a quirk in that the listed episode number may mismatch expectations, but the other metadata will be correct.

My conclusion for TV Shows after doing pretty much the same as what you did

  • Gracenote data is used for matching and is inconsistent and often changes after something airs
  • S##E## should not be used for matching with Gracenote (or should be last resort after Ep Title)
  • Like you said, use the Episode Title for matching

My other issues is when you try to match, the results aren't sorted alphabetically (I presume they're by a search score). If they were alphabetical it would be easier to spot if you had a match available to choose.

Having used Plex before, I name
Movies: Title (Year)/Title (Year).ext and additional info goes after (Year) like Gravity (2013) -h264.ts
TV Shows: Title (Year)/Season ##/Title (Year) - S##E## - Episode Tile (OAD).ext

I haven't had any issues importing TV Series if Gracenote has data for them.

For episodic serials, I want to watch them in order by Season and Episode.

If a show isn't an episodic serial, I could care less about Season and Episode, just give me the Episode Title.

One example I have that's not a serial is Farming the Wild (2018).
It imports as unmatched and I leave it that way so I can see the Episode Titles.

If I match it using SH030187620000, I lose the Episode Titles because Gracenote doesn't identify the Seasons and Episodes https://tvlistings.zap2it.com/overview.html?programSeriesId=SH03018762&tmsId=SH030187620000

I got the Episode Title from Channels DVR when it recorded it and the Season and Episode numbers from the channel that aired it https://app.myoutdoortv.com/shows/farming-the-wild

It doesn’t even bring the episode title in when scanning. Just the episode snd season number for looking it up. So it’s not there to show.

We’ll look at consuming them title, but title isn’t a big requirement for our scanner, so it’s tricky.

I would strongly encourage you to also use original air date as the fallback for episode title (and in preference to Exx episode number). The challenge with episode title is that due to punctuation, abbreviations, etc., a good episode-title compare algorithm is tricky. By contrast, original airdate is both unambiguous and a trivial comparison.

Thanks.
If it helps I have a series pass for that show and there's some upcoming airings.
I marked these as Not Recorded so they'll record again this Saturday and next Monday.

Title "Farming the Wild"
SeriesID "15775579"

EpisodeTitle "Stalking Red Deer Hinds in Scotland"
ProgramID "EP030187620011"
OriginalDate "2020-07-13"

EpisodeTitle "Invasive Species 2. (Sika & Rabbits)"
ProgramID "EP030187620016"
OriginalDate "2020-09-28"

Argh, looks like things have changed since I originally imported that show.

I just did a test and moved the files, Prune Deleted and verified they don't appear in the library.

I then moved the files back and Scan Sources.

Now it imports them with an incorrect match.

Can we get an option to "Unmatch" please.

I resolved the issue for my needs. Not elegant, but nicely self-contained. After doing an import, I run a custom script that downloads the library episode content (http://dvr.lxc.lan:8089/dvr/files) and then performs a two pass analysis:

Pass #1: Create two lookup tables for each series that maps episode-name and air-date to the episode number. Essentially this just harvests the existing metadata that Channels previously downloaded.

Pass #2: For each mismatched episode (i.e., both the episode-name and air-date as encoded in the import filename mismatch the metadata), lookup the episode number using the lookup table from pass 1 (first via episode-name and then via air-date). For episodes with a remap correction, rename them to the new episode number. Then delete the episode (curl -s -X DELETE http://dvr.lxc.lan:8089/dvr/files/$id) and permanently delete the episode (curl -s -X PUT http://dvr.lxc.lan:8089/dvr/files/$id/permanently_delete). After all renames/deletes, trigger a rescan (curl -s -XPUT http://dvr.lxc.lan:8089//dvr/scanner/scan).

Because this uses Channels own metadata to find the mismatches and make corrections, it relies on all the mismatched episodes being imported. Since an entire season (or more) is typically imported at once, this is a non-issue in practice. By renaming the file to the updated episode number prior to the delete/permanently_delete, the latter removes the incorrect metadata without impacting the import file contents.

There is some complexity in that you need to parse the air-date and episode-name from whatever format your import files use. And of course, the "find by episode name" is only as good as whatever fuzzy string match you implement. Hope this helps someone else.

1 Like

I've been struggling with some series matches, when bringing in the first three seasons of Top Gear USA Channels insists on putting some episodes in Season 5, etc. I just renamed the episode titles out of them and they

"Top Gear USA\Season 3\S3e03 - Cult Classics.mp4"
"Top Gear USA\Season 3\S3e02 - Small Cars.mp4"
"Top Gear USA\Season 3\S3e01 - Police Cars.mp4"

turned into

"Top Gear USA\Season 3\S3e02.mp4"
"Top Gear USA\Season 3\S3e03.mp4"
"Top Gear USA\Season 3\S3e01.mp4"

This got Channels to keep them in the rights seasons on the menu, but, of course, the titles are lost now for many of the episodes, I guess Gracenote doesn't have them? Is there a way I can check?

fwiw, I only sorted those files in "Season 3" subdirectories because I read a guide article somewhere here saying that was the way to do it. Now I'm guessing that they could all be in one directory.

So now I get this and strongly favor keying on airdates and episode titles, it would fix this.

Here is an example of one that fails if the title ("RVs") is left in the filename, Channels imports this as Season 5 episode 3, as shown below.

{"ID":"1748","GroupID":"8353602","Path":"Top Gear USA/Season 3/S3e09 - RV's.mp4","CreatedAt":1631336624,"Duration":2657.551,"Completed":true,"Processed":true,"Airing":{"Source":"tms","OriginalDate":"2013-02-12","Time":1360627200,"Duration":0,"Title":"Top Gear","EpisodeTitle":"RVs","Summary":"The guys design an RV to take on a southern road trip and compete in a series of wild challenges.","FullSummary":"The guys design an RV to take on a southern road trip and compete in a series of wild challenges.","Image":"https://tmsimg.fancybits.co/assets/p10777099_b_h9_aa.jpg?w=720\u0026h=540","Categories":["Episode","Series"],"Genres":["Entertainment","Auto","Comedy"],"Tags":["HD","Stereo"],"SeriesID":"8353602","ProgramID":"EP013412100035","SeasonNumber":5,"EpisodeNumber":3,"Cast":["Adam Ferrara","Tanner Foust","Rutledge Wood"],"ReleaseYear":2013,"Raw":{"startTime":"2013-02-12T00:00Z","endTime":"","duration":0,"channels":null,"stationId":"","qualifiers":null,"ratings":null,"program":{"tmsId":"EP013412100035","rootId":"9708917","seriesId":"8353602","entityType":"Episode","subType":"Series","title":"Top Gear","titleLang":"en","episodeTitle":"RVs","episodeNum":3,"seasonNum":5,"releaseYear":2013,"releaseDate":"2013-02-12","origAirDate":"2013-02-12","descriptionLang":"en","shortDescription":"The guys design an RV to take on a southern road trip and compete in a series of wild challenges.","longDescription":"The guys design an RV to take on a southern road trip and compete in a series of wild challenges.","topCast":["Adam Ferrara","Tanner Foust","Rutledge Wood"],"genres":["Entertainment","Auto","Comedy"],"preferredImage":{"uri":"https://tmsimg.fancybits.co/assets/p10777099_b_h9_aa.jpg?w=720\u0026h=540","height":"540","width":"720","primary":"true","category":"Banner-L1","text":"yes","tier":"Season"},"runTime":"PT00H45M"}}},"UpdatedAt":1631925765106,"ImportPath":"/media/publib/TV","ImportQuery":"Top Gear USA","ImportGroup":"8353602","ImportedAt":1631925764563},

You can check the Gracenote data Channels uses for matching at www.zap2it.com
They list three Top Gear shows, click on the Episode Guide tab for each to see the episodes

When you find the right one, you can use the tmsId to match the show you imported

Top Gear America (2017) 2 Seasons https://tvlistings.zap2it.com/overview.html?programSeriesId=SH02730918&tmsId=SH027309180000

Top Gear (2002) 30 Seasons https://tvlistings.zap2it.com/overview.html?programSeriesId=SH00335172&tmsId=SH003351720000

Top Gear (2010) 8 Seasons https://tvlistings.zap2it.com/overview.html?programSeriesId=SH01341210&tmsId=SH013412100000

I'm waiting until the devs work on this Imported TV Show matching issue before importing all my shows.

Thanks! It was Top Gear (2010) 8 seasons. From looking at this, Gracenote's data is simply missing for a bunch of the episodes, so that makes sense. Still not sure what Channels matching did what it did for the rest of them.

Based on my experience, interim directories like "Season 3" are not required. I don't use them myself.

Believe the incorrect season may be due to using a single-digit SxExx. Have never seen Channels put into the wrong season with SxxExx (both double digits). From my experience, it does not even look at the episode names so am confused how it might place those in the wrong season.

Note you say Channels was putting the episodes in season 5, but their data has them in season 4 (not season 3/5). Was that a typo?

Gracenote shows 8 seasons where the rest of the world shows 6. That said, the six seasons from the rest of the world looks mighty odd. The cause is obvious when you look at the air dates:

Season 1 (everyone): 10 episodes from Nov 21, 2010 - Jan 23, 2010
Season 2a (everyone): 8 episodes from July 24, 2011 - Sep 18, 2011
Season 2b (wikipedia/others): 8 episodes from Feb 14, 2012 - Apr 3, 2021
Season 3 (Gracenote): Feb 14, 2012 - Apr 3, 2021

What non-Gracenote lists as 6 seasons includes seasons (like season 2) that had a five month gap in he middle. Gracenote splits those into discrete seasons whereas other sources keep them together. The wikipedia article includes the non-sensical comment " The season was aired from July 24, 2011 until April 3, 2012 on [History], airing on a weekly basis". (Airing on a weekly basis means something different to me.)

What episodes do you see missing? I did not find anything missing, just in different seasons because of how they handled the odd double-seasons.

BBC, IMDB, Wikipedia, Amazon Prime, DVD sales, etc, all say there were six seasons. I can't find a single other source then Gracenote that says eight. Having wasted time researching this today: I concur. This is not a Channels issue at all, other than that Channels uses Gracenote. The ones I called "missing" were missing Gracenote titling because I removed the titles, then Gracenote couldn't tag that way. Then Channels stuck to the sXXeXX naming.

During my research today I became aware of (roughly) how many freaking spin-offs there have been and how some are not named consistently, especially the example at hand.

Maddox says up above, though:

It doesn’t even bring the episode title in when scanning. Just the episode snd season number for looking it up. So it’s not there to show.

It clearly does use the title or directory name at some point, though, or it wouldn't have been able to match the S3E9 "RVs" to what Gracenote says is S5E3.

Note you say Channels was putting the episodes in season 5, but their data has them in season 4 (not season 3/5). Was that a typo?

Don't think so. Gracenote called it season 5, and Channels tags it as such. All 72 episodes are there, just split up differently. I see how what I wrote was confusing, the episode I listed as an example was not one of the ones it put in Season five, the full data listing down below was one that did that.

Believe the incorrect season may be due to using a single-digit SxExx. Have never seen Channels put into the wrong season with SxxExx (both double digits). From my experience, it does not even look at the episode names so am confused how it might place those in the wrong season.

I retried it after I posted renaming S3e09 to s03e09, fully expansion, for the "RVs" ep, It still matched the same way.

I don't know this to be accurate, but it appears to me that Channels will try to do the looking with just sXX and eXX, but if it comes up blank will use title and other information from the path to do it's best. Or I've confused myself beyond redemption ----

I believe you are correct. In all my testing, don't think I ever passed SxxExx combinations that were missing from their season data. It sometimes mapped to the wrong episode (and thus my need to remap them correctly), but there was always some episode of that number. The Gracenote Top Gear US Season 3 is only 8 episodes. Since S03E09 has no mapping, Channels apparently falls back to a title search.

Appreciate the clarification-- that makes sense.

Agreed. Did lots of searching as well and only Gracenote lists eight. Granted, I still struggle with the concept of a "season" that includes a five month break in the middle. Am guessing Gracenote does some data normalization and the significant mid-season-break triggers a heuristic rule that divides the season. Thanks for the follow up and additional details.

My 2 cents worth.

For "Series" that aren't serials, I see no need to watch them in airdate or production number order.
I don't care what "Season number and Episode number" somebody tags them with since not everyone agrees on what they are anyway, especially Gracenote vs. the rest of the world.

I just want Channels to import them with;
Show Name and artwork/poster
Episode Title
Episode Description
Episode OAD or Year if available

Agree that ordering (within reason) is a minor issue. Understanding the difference between airdate and production is important to understand why mismatches occur. After all, production order was the expecting airing and airdate order was actual airing based on distribution needs-- neither is right/wrong-- just variations.

I get annoyed when episodes are misidentified (and when they contain 110% of the data required to identify them correctly). Art, description and everything else seems to follow from that. Have yet to see situations where an episode season/number/title is correct and other aspects are wrong. Confident it happens, but not experienced it for shows of interest to me (so far).

Do you use a tag editor / file naming utility with online lookup? I've used several (mainly mp3 Tag and MusicBrainz) for audio files, this is the first time I've thought about corralling a growing video collection.

Like you, I previously to used identification tools when ripping my CDs to MP3s. However, I only use digital audio with my iPhone these days and it identifies audio without any special effort.

My video identification needs are different from most. Bulk of my content is VOD (video on demand) that I force-feed Channels. My challenge is reconciling EPG data from Pluto, Xumo, Discovery, etc (my VOD sources) with Channels/Gracenote.

If you are comfortable doing it, you can query Channels directly for movie/series information via:

curl -s "http://channels-dvr-url:port/dvr/groups/0/matches?q=your-query"

This will return Gracenote data (JSON formatted) for movies/series (not episodes-- remove any episode details). Best strategy is passing the full name first and looking for an appropriate match. If you find one, use the exact movie/series title (as returned) along with the release year in parenthesis. The latter is critical.

Your Top Gear example illustrates this well. Was purely luck that a "Top Gear" query (without a year) returns Top Gear USA as the first hit. If your episodes were Top Gear UK-- game over.

Returns all Top Gear series in a random-to-me order:

curl -s "http://localhost:8089/dvr/groups/0/matches?q=top+gear"

Returns Top Gear USA as first hit:

curl -s "http://localhost:8089/dvr/groups/0/matches?q=top+gear+(2010)"

Returns Top Gear UK as first hit:

curl -s "http://localhost:8089/dvr/groups/0/matches?q=top+gear+(2002)"

The Channels import matching code takes the first hit. For "unique" movies/series (no foreign spinoffs or name reuse), it is reliable. Increasingly, with most folks in media production being devoid of new ideas and simply rehashing old content, content reuse is the norm and original release year is critical to identify the specific movie/series. For episodic content, once the series is correctly identified, another API can be used to query episodes for detailed matching via name, airdate, episode number, etc. However, none of that matters unless you can correctly identify the series first.

Not quite the answer you were looking for, but hope it helps.

No, not for the current problem, which I think has now moved to the "I know I have all the episodes in order so who cares that Gracenote calls them something different that every over source I can find, so I don't care".

But, for future work I need to do I see the purpose of this, very valuable. I am comfortable with command line and scripting, just not very knowledgeable about what all can be called with it.

Thank you!