Drone CDH needs to be smarter than Drone Factory

I’ve had this issue twice now, and it relates to scene naming and is quite a complicated issue. But I’ve labelled the topic name relating to what I think is the most elegant fix.

I’ve had this issue with two series, House of Cards 2013, and Touch Young Teachers.

Here are two examples of what NZBDrone pulled from Dog when searching for episodes:
Tough.Young.Teachers.UK.S01E01.HDTV.x264-DEADPOOL
House.of.Cards.S01E09.WEBRip.720p.H.264.AAC.2.0-HoC

There are more for their respective series. Now, the main thing to point out here is that the release of Tough Young Teachers is marked “UK”. Equally, for House of Cards, there is no “2013” or “US” marked in the title. For the former, I have already added a scene exception on the relevant Google Docs form. The latter is slightly more complicated - it would be incorrect to add a scene exception in this instance.

For me, this raises two issues.

  1. Why has the scraper found this HoC release, yet the renamer’s algorithm clearly discriminates? In other words, it seems like the scraper is completely happy with pulling this release, but the renamer is using a different algorithm and decides its not applicable.

  2. The CDH (Completed Download Handler) is in an advantaged position in that in can link an NZB directly to its extracted folder/files. It should not need to use a title matching algorithm to locate the relevant episode. Or, at the very least, it should be more lenient when it has been able to match the file but returns a partial match on the filename (or even an option to enforce matching priority from NZB linking). This should also help with situations where the filename of the download is completely random compared with the NZB (I’ve also had this a few times).

My suggestion is to provide CDH with a different algorithm with the Drone Factory - it should be able to utilize the extra knowledge it has over the background of the download and use that to better detect file releases. This would create an alternative, better and long-term solution over scene naming exceptions (at least for the importing process).

Cheers, you’ve done a great job on Drone thus far :).

===============
EDIT: Markus has just commented regarding #1, which makes sense:
<@markus101> it grabbed it because the tv rage id matched
<@markus101> but thats not available when importing
Regardless, i think my suggestion is still relevant.

There are a couple other things that we need to fix, which I’m also going to take a look at.

Can you elaborate on this particular issue?

  1. Yes, drone somewhat trusts the indexer in terms of what to download, but is conservative with imports.

  2. Yes CDH has more information, and during the CDH development I considered this as a potential feature. But at that time, the code changes involved in CDH were already massive and we couldn’t afford additional unknown factors.
    Atm the History -> Queue page shows all rejected CDH imports except for errors in naming, which was already a huge improvement over the non-existent UI for the Drone Factory.
    Adding naming errors on the same page and allowing the user to pick a ‘recommended’ option to resolve it would be the next step.
    We’ve been pointing at ‘https://trello.com/c/kr7Jonk4/304-manually-override-drone-factory-imports’ to cover it.

The reason for being conservative is that if we didn’t drone could delete an existing episode file to ‘upgrade’ it to something bad. So it’s better to download it and then ask the user what to do, than blindly import.
In your case, this might have been the the original 1990 House of Card series, which you don’t want to be imported into your 2013 directory automatically.

That’s also the problem with your suggestion.
The NZB doesn’t give any more information, the NZB title is (tnx to sabnzbd/nzbget) also the same as the root directory).
The only additional information would be the tvrageid the indexer provides.
If the indexer says its “House of Cards 2013” and the nzb says “House of Cards” (1990), then what should drone do?
I certainly wouldn’t want drone to blindly import that one. I rather throw up a flag and have the user decide than have the computer toss a coin.
I’ve seen a few times that the indexer attributed some release to a completely wrong tvrageid. So blindly trusting the indexer is a no-go.
Scene naming exceptions are basically us telling the computer “yes, a user looked at it, and you should import”.

In case of your release, there really isn’t a right automated answer, since that nzbgeek release is incorrectly named and conflicting with the 1990 series. So we can’t apply a naming exception to it.

So yes, your suggestion makes sense but only so we can provide the user with a choice on the UI.

We also have a todo in the code and on trello to automatically report discrepancies to our services. https://trello.com/c/IJmdBQ2k/315-report-when-tvrage-match-is-found-but-title-check-failed

This is when the filename is encrypted. My indexer provides NZBDrone with the correct NZB, but then after download you get a [random hash].mkv, which NZBDrone’s CDH has no idea how to handle or rename.