warren-bank / Android-Tiny-Television-Time-Tracker

A Reboot of DroidSeries Offline TV Shows Tracker
http://ltguillaume.github.io/DroidShows
GNU General Public License v3.0
12 stars 1 forks source link

restore only adds shows but not watch status #2

Open jmichael2497 opened 1 year ago

jmichael2497 commented 1 year ago

tested on LineageOS (A13) Moto x4 migrating from DroidShows (F-Droid) 7.11.2

not sure if restore is supposed to be working again yet, lacking changelog or mention of any other forum to discuss (this github About links to 404 http://ltguillaume.github.io/DroidShows which seems meant to point upstream github, and in app still links to XDA for DroidShows)

i did test out multiple versions starting from v4 where it switched to its own unique name not trying to install over DroidShows and few around there, with weird always backup before restoring bug that ended up restoring empty new backup, or not waiting for reply from TMDB so everything fast failed...

then v18 and latest v22 from a few months ago, which at least downloads all the shows (except a foreign miniseries which i deleted to make sure that didn't cause issues), but no watch status update (or pin status, but does have active vs archive correct) after taking 15min to download 90shows from my almost 5MB db (only able to complete with screen kept on).

hopefully the restore function gets... restored before i run out of show updates, since any further attempts in older apps is getting partial data and deleting existing older seasons (but i could just manually go through marking the status in the 90 shows).

thanks for keeping this alive, cheers.

warren-bank commented 1 year ago

just a quick check whether the polyfill library where this bug occurs has been fixed after the tagged version being used..

..no change; hasn't been fixed upstream

warren-bank commented 1 year ago

will be pushing a new release in a few minutes.. that line of code was the culprit.. new version will fix unicode characters.

huge thanks for reporting that issue!

update:

casperklein commented 1 year ago

I can confirm, that now the unicode problem is fixed 🎉

While migrating, there might be a rate-limit or something else, which causes some requests (16 of 350 in my case) to fail:

Downloading series: Severance no results Downloading series: Squid Game no results

After importing TV-Tracker.db, those shows are missing the covers. However, updating one affected show or all together fixes the problem 👍

warren-bank commented 1 year ago

I just released another update.. v1.0.2

It fixes the problem with the TMDB API client.. that could cause it to ignore the results when attempting to lookup the ID of a series by its corresponding TVDB ID.. and resulting in the MAPPING_FAILED log messages.

"Fix" is a bit strong.. it just removes the parts that weren't working, because they were unused anyway.

The following notes are included mainly for my own future reference… ```text -------------------------------------------------------------------------------- succeed: ===== http://api.themoviedb.org/3/find/307474?api_key=c9eb196aaf70baf91d4ce4f0fea6a360&external_source=tvdb_id ===== { "movie_results": [], "person_results": [], "tv_results": [{ "adult": false, "backdrop_path": "/zIsEKq9n0DEk3gUJGmt3cWCEiKl.jpg", "id": 66606, "name": "Roots", "original_language": "en", "original_name": "Roots", "overview": "An adaptation of Alex Haley's \"Roots\", chronicling the history of an African slave, Kunta Kinte sold to America and his descendants.", "poster_path": "/nBYRp5pL1FPEfMpfDgfM1Fo4oCS.jpg", "media_type": "tv", "genre_ids": [18, 10759], "popularity": 13.774, "first_air_date": "2016-05-30", "vote_average": 6.886, "vote_count": 149, "origin_country": ["US"] }], "tv_episode_results": [], "tv_season_results": [] } -------------------------------------------------------------------------------- succeed: ===== http://api.themoviedb.org/3/find/78874?api_key=c9eb196aaf70baf91d4ce4f0fea6a360&external_source=tvdb_id ===== { "movie_results": [], "person_results": [], "tv_results": [{ "adult": false, "backdrop_path": "/iP9Xjlc8KRmXE0kVMTaJRaN0umh.jpg", "id": 1437, "name": "Firefly", "original_language": "en", "original_name": "Firefly", "overview": "In the year 2517, after the arrival of humans in a new star system, follow the adventures of the renegade crew of Serenity, a \"Firefly-class\" spaceship. The ensemble cast portrays the nine characters who live on Serenity.", "poster_path": "/vZcKsy4sGAvWMVqLluwYuoi11Kj.jpg", "media_type": "tv", "genre_ids": [18, 10759, 10765], "popularity": 35.575, "first_air_date": "2002-09-20", "vote_average": 8.323, "vote_count": 1756, "origin_country": ["US"] }], "tv_episode_results": [], "tv_season_results": [] } -------------------------------------------------------------------------------- fail: ===== http://api.themoviedb.org/3/find/81560?api_key=c9eb196aaf70baf91d4ce4f0fea6a360&external_source=tvdb_id ===== { "movie_results": [], "person_results": [], "tv_results": [{ "adult": false, "backdrop_path": "/1OLWHNAfJF48d08JJI4qUZH3bSJ.jpg", "id": 15571, "name": "Holocaust", "original_language": "en", "original_name": "Holocaust", "overview": "Berlin, Germany, 1935. The day Karl Weiss, a Jewish painter, and Inga Helms, a Christian woman, marry, is the one in which both of them and the entire Weiss family are caught up in the maelstrom of the Nazi regime, the storms of World War II and the horrors of the criminal Final Solution, the Holocaust, the Shoah; while Erik Dorf, an ambitious lawyer, undertakes his fall into hell at the hands of the sinister Reinhard Heydrich.", "poster_path": "/gK1gnzIOwZWuTqp4HGEPmjTMijg.jpg", "media_type": "tv", "genre_ids": [18, 10768], "popularity": 6.732, "first_air_date": "1978-04-16", "vote_average": 7.5, "vote_count": 55, "origin_country": ["US"] }], "tv_episode_results": [{ "id": 445875, "name": "Host: Jimmy Durante", "overview": "Host: Jimmy Durante --Ethel Merman --Sugar Ray Robinson --Vikki Carr --Bill Dana --Leland Palmer --Hendra \u0026 Ullett", "media_type": "tv_episode", "vote_average": 0.0, "vote_count": 0, "air_date": "1968-12-14", "episode_number": 11, "production_code": "", "runtime": 60, "season_number": 6, "show_id": 11142, "still_path": null }], "tv_season_results": [] } -------------------------------------------------------------------------------- fail: ===== http://api.themoviedb.org/3/find/82507?api_key=c9eb196aaf70baf91d4ce4f0fea6a360&external_source=tvdb_id ===== { "movie_results": [], "person_results": [], "tv_results": [{ "adult": false, "backdrop_path": "/fJa29nluTKy4qOc5kyyGZfCuDDc.jpg", "id": 5739, "name": "Dr. Horrible's Sing-Along Blog", "original_language": "en", "original_name": "Dr. Horrible's Sing-Along Blog", "overview": "Aspiring super-villain Dr. Horrible wants to join the Evil League of Evil and win the girl of his dreams, but his nemesis, Captain Hammer, stops him at every turn.", "poster_path": "/wPXpC4AJHlwnVk5AtlBgsd0497c.jpg", "media_type": "tv", "genre_ids": [35, 18, 10765], "popularity": 9.594, "first_air_date": "2008-07-15", "vote_average": 7.549, "vote_count": 460, "origin_country": ["US"] }], "tv_episode_results": [{ "id": 143384, "name": "Lost and Floundering", "overview": "Paul and Barry are put in charge of a lost and found office.", "media_type": "tv_episode", "vote_average": 0.0, "vote_count": 0, "air_date": "2001-03-07", "episode_number": 12, "production_code": "", "runtime": 20, "season_number": 13, "show_id": 2082, "still_path": null }], "tv_season_results": [] } -------------------------------------------------------------------------------- https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/TV-Tracker/src/main/java/com/github/warren_bank/tiny_television_time_tracker/database/Update.java#L643-L651 String thetvdbid = thetvdbids.get(i); String imdbid = imdbids.get(i); int tmdbid; Map origins = new HashMap(); origins.put("thetvdb", thetvdbid); origins.put("imdb", imdbid); tmdbid = api.findSeriesByExternalId(origins); https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/TV-Tracker/src/main/java/com/github/warren_bank/tiny_television_time_tracker/api/ApiGateway.java#L69 this.api = new TheMovieDbApi( context.getString(R.string.api_key) ); https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/TV-Tracker/src/main/java/com/github/warren_bank/tiny_television_time_tracker/api/ApiGateway.java#L80 public int findSeriesByExternalId(Map origins, String language) https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/TV-Tracker/src/main/java/com/github/warren_bank/tiny_television_time_tracker/api/ApiGateway.java#L98 public int findSeriesByExternalId(String origin, String externalId, String language) https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/TV-Tracker/src/main/java/com/github/warren_bank/tiny_television_time_tracker/api/ApiGateway.java#L111 public int findSeriesByExternalId(ExternalSource origin, String externalId, String language) { FindResults response = api.find(externalId, origin, language); } https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L36 import com.omertron.themoviedbapi.methods.TmdbFind; https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L48 import com.omertron.themoviedbapi.model.FindResults; https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L665 public FindResults find(String id, ExternalSource externalSource, String language) throws MovieDbException { return tmdbFind.find(id, externalSource, language); } https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/methods/TmdbFind.java#L39 public class TmdbFind extends AbstractMethod https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/methods/TmdbFind.java#L72-L86 public FindResults find(String id, ExternalSource externalSource, String language) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, id); parameters.add(Param.LANGUAGE, language); parameters.add(Param.EXTERNAL_SOURCE, externalSource.getPropertyString()); URL url = new ApiUrl(apiKey, MethodBase.FIND).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { return MAPPER.readValue(webpage, FindResults.class); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get find results", url, ex); } } https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java#L23 import com.fasterxml.jackson.databind.ObjectMapper; https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java#L71 protected static final ObjectMapper MAPPER = new ObjectMapper(); https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/AbstractJsonMapping.java#L35 public abstract class AbstractJsonMapping https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/FindResults.java#L34 public class FindResults extends AbstractJsonMapping https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/FindResults.java#L26 import com.omertron.themoviedbapi.model.tv.TVEpisodeBasic; https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/FindResults.java#L46-L47 @JsonProperty("tv_episode_results") private List tvEpisodeResults; https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/tv/TVEpisodeBasic.java#L32 public class TVEpisodeBasic extends MediaBasic https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/tv/TVEpisodeBasic.java#L24 import com.omertron.themoviedbapi.model.media.MediaBasic; https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/tv/TVEpisodeBasic.java#L36-L49 @JsonProperty("air_date") @JsonProperty("season_number") @JsonProperty("episode_number") @JsonProperty("name") @JsonProperty("overview") @JsonProperty("still_path") @JsonProperty("show_id") https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/media/MediaBasic.java#L34 public class MediaBasic extends AbstractJsonMapping https://github.com/warren-bank/Android-Tiny-Television-Time-Tracker/blob/tmdb/008.00.23-09API/android-studio-project/libs/api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/media/MediaBasic.java#L38-L50 @JsonProperty("id") @JsonProperty("backdrop_path") @JsonProperty("poster_path") @JsonProperty("popularity") @JsonProperty("vote_average") @JsonProperty("vote_count") -------------------------------------------------------------------------------- "tv_episode_results" fields in JSON response: "id" "name" "overview" "media_type" "vote_average" "vote_count" "air_date" "episode_number" "production_code" "runtime" "season_number" "show_id" "still_path" missing fields: "backdrop_path" "poster_path" "popularity" -------------------------------------------------------------------------------- https://fasterxml.github.io/jackson-databind/javadoc/2.13/com/fasterxml/jackson/databind/ObjectMapper.html http://fasterxml.github.io/jackson-annotations/javadoc/2.13/com/fasterxml/jackson/annotation/JsonIgnoreProperties.html#ignoreUnknown-- https://github.com/FasterXML/jackson-annotations/wiki/Jackson-Annotations https://github.com/FasterXML/jackson-databind/wiki/Databind-annotations https://github.com/FasterXML/jackson-databind/wiki/Deserialization-Features https://www.baeldung.com/jackson-annotations#jackson-deserialization-annotations https://www.baeldung.com/jackson-deserialization https://www.baeldung.com/jackson-deserialize-json-unknown-properties https://www.baeldung.com/jackson-ignore-null-fields -------------------------------------------------------------------------------- https://github.com/Omertron/api-themoviedb/issues -------------------------------------------------------------------------------- ```