SchizoDuckie / DuckieTV

A web application built with AngularJS to track your favorite tv-shows with semi-automagic torrent integration
http://schizoduckie.github.io/DuckieTV/
Other
1.12k stars 277 forks source link

cannot customize search string for atypical season/episode numbering #1379

Closed samandiriel closed 1 year ago

samandiriel commented 1 year ago

What build of DuckieTV are you using (Standlone / Chrome Extension (New Tab / Browser Action)) Stand alone

What version of DuckieTV are you using (Stable 1.1.x / Nightly yyyymmddHHMM) 202301170837

What is your Operating System (Windows, Mac, Linux, Android) Windows

Describe the problem you are having and steps to reproduce if available

  1. Add One Piece to favorites & to auto-download with preference for nyaa for torrents
  2. auto download fails
  3. open manual download
  4. search string shows as s21e1###
  5. anime often does not use season, and in this case episode # is for the entire series run (eg, 1029)
  6. no option to change season/episode, just to append strings to default search string

Attach any DuckieTV statistics or Developer Console logs if available ...

garfield69 commented 1 year ago

Dtv uses https://theXem.info to provide a cross-reference for the anime tvdb and torrent scene naming reconciliation. So usually this takes care of correctly naming the episode for torrent searching. However, looking at the Dtv code, I see that it presumes that the absolute number of an episode supports only up to 999 and as you have already discovered One Piece is at 1050 already.

I shall see if I can update Dtv to handle 4 digit absolute episode numbers.

samandiriel commented 1 year ago

Thank you! Hopefully that will resolve the anime season/episode naming issue then too.

garfield69 commented 1 year ago

ok. the base problem is that the trakt.tv API which is where Dtv fetches all its show data, has not loaded the absolute episode number for the episodes 1036-1053 this is the main reason why the search defaults to using the s21exxxx for the search instead of using the absolute number in the search query. the quick fix for this while we wait for trakt.tv to get around to updating their API database is for you to update your DTv database directly. startup dtv, and press F12 to open the development tools page, and click on the console tab to access the log. at the command line, at the bottom of the log, where the > prompt is, paste the content of the following and press enter:

CRUD.executeQuery("update episodes set absolute = 1036 where episodenumber == 1036 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1037 where episodenumber == 1037 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1038 where episodenumber == 1038 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1039 where episodenumber == 1039 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1040 where episodenumber == 1040 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1041 where episodenumber == 1041 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1042 where episodenumber == 1042 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1043 where episodenumber == 1043 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1044 where episodenumber == 1044 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1045 where episodenumber == 1045 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1046 where episodenumber == 1046 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1047 where episodenumber == 1047 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1048 where episodenumber == 1048 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1049 where episodenumber == 1049 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1050 where episodenumber == 1050 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1051 where episodenumber == 1051 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1052 where episodenumber == 1052 and seasonnumber == 21").then(function(result) { console.log(result); })
CRUD.executeQuery("update episodes set absolute = 1053 where episodenumber == 1053 and seasonnumber == 21").then(function(result) { console.log(result); })

this should allow the search for these episodes to work.

I still have to figure out why the series episodes list display for season 21 only goes up to absolute 999. The Dtv database has all the episodes up to 1053, so that is a puzzle I will continue working on. [edit2] Oh, the episodes panel does show all 159 episodes, its just the HTML sort is sorting then alphabetically rather than numerically. progress. just got to figure out of I can sort numerically. But at least the calendar shows all the episodes so that's the way to access the episode details for now.

[edit] Note: if Dtv does a trakt.tv update and those 1036-> episodes loose then absolute number again, then you will find you need to re-apply the absolute numbers fix. Nothing I can do about that, its totally dependent on trakt.tv data. If it goes on too long consider raising a query on trakt.tv to get someone to update the API data.

garfield69 commented 1 year ago

4cbb97839758be9be765c4608e660c71f9026eca fixes the episodes list sidepanel not sorting episodes > 1000 correctly. I'll create a build presently.

garfield69 commented 1 year ago

https://github.com/DuckieTV/Nightlies/releases/tag/nightly-202302071749 for the episodeslist sidepanel sort.

samandiriel commented 1 year ago

Fantastic, looking forward to giving it a try! Thanks very much indeed

samandiriel commented 1 year ago

Unfortunately this hasn't resolved the issue - the search string still defaults to having the season prefix to the episode: "One Piece s21e1052"

This is invalid for all torrents/sites I have searched for One Piece; it should just be "One Piece 1052"

garfield69 commented 1 year ago

Until such time as trakt.tv finally gets around to updating their API database, you will need to execute the commands from https://github.com/SchizoDuckie/DuckieTV/issues/1379#issuecomment-1419728009 to supplement the trakt.tv records that Dtv gets from the trakt.tv API servers. OR to put it another way, your manual update of those one piece episodes are temporary, because when Dtv goes to Trat.tv to check for any episode updates, it recognises that the trakt.tv records are different from the ones Dtv has in its database and replaces them with those from trakt.tv, effectively resetting your manual customisation. There is nothing more I can do about this, the issue is that trakt.tv's episode data is not up to date.