-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restore only adds shows but not watch status #2
Comments
just to be clear, can you confirm that this is what you've already tried?
when migration finally completes..
could it be possible to get a copy?..
|
correction.. the migration process does set wakelocks leaving the screen on shouldn't be necessary.. |
yes, you understood correctly on what i did. i did keep the screen on as it seemed otherwise power saving kicked in and stopped the app with an error message, despite setting app to be unrestricted in battery (maybe because i always keep battery saver mode active)... although now that i think of it, i may have misattributed the error about the single foreign show it couldn't find, and the lack of watch status as being a migration failure from power management closing it. i will test again now, to verify as it should only take 15min with screen on and that one show already removed from the source backup. (also if you have a way to share the source db through private message?) |
i plugged in phone to power in addition to turning off battery optimization for the app, just in case, and it completed... eventually (distracted watching a show, still not 1/3 of way after 30min, but done within 50min. no toast or log just opened up to blank screen, which i'd encountered in an earlier test, so exited and reopened, just has all shows without watched status transferred (nor pin status, but does have active vs archive correct), exited and reopened, no change. original db source is 4.8MB, after import and re-export now 4.9MB. i will go ahead and setup the temporary share in a few minutes. |
OK.. I've got the db files. I'll be honest.. |
just quickly inspecting the contents of the 2x SQLite db files (using: DB Browser for SQLite)..
These are temporary tables that contain data from the old db that will need to be merged back into the new db.. such as, for example, the timestamps for when episodes had been seen. This merging process is performed after all of the series/episode data has been downloaded from the API and used to populate tables in the new db. |
i forgot i had the portable version of that SQL browser on here from tinkering with a podcast db... but i noticed google drive offered to open the files directly in browser, and was wondering about those 2 migration tables as well. after restore of the source version with the one ambiguous to match show removed ahead of time, i just ended up with no floating window indication that things were still running after the x/90 window completed. while a standalone migration tool might be nice, definitely would make it an advanced user solution, which would be fine for me, but... then it loses accessibility for a lot of folks. |
I could be wrong about this, as I haven't looked at the code or used it in quite a while..
|
well i've got a few shows in the source db to keep me entertained for at least a month before i run out of trackable data and can't refresh from TVDB, i should be off to sleep myself, so no hurry, cheers for keeping this app going 👍 |
I'll run the migration here.. and let you know when I have a db file that you can use. When ready.. if you want to grant me write permission to your Google Drive directory.. I can upload it privately. |
i have at least one friend i got started using DroidShows (and also happens to be an advanced user that wouldn't mind running a separate conversion tool)... and you probably don't want to be doing everyone's conversion manually, so thank you for the offer, though it would be more beneficial to have a reproducible working method. if you can confirm the f-droid 7.11.2 db backup can restore into the v22 build with watch status, and approx how long it takes... then i'll give it another try myself or try to assist with more data and testing newer builds. |
also potential room for migration optimization might involve the media cover art pulled is my guess, because i'm noticing my typical monthly wifi usage with DroidShows is around 15MB... but currently with a few import attempts since reinstall of A4T v22 shows 516MB download (split almost half foreground vs background), and 23MB upload. once you can confirm the import with my db worked correctly for you, i'll uninstall/reinstall, and reproduce to get precise wifi usage stats for you. |
I did a fresh install of the app on my tv box.. started a migration.. and went to bed; When I woke up I noticed 2 things:
|
curious what A# version your tv box is, but if the import of my DroidShows source file worked for you, showing viewed status and all, then i will try one more reinstall and import on my A13 based mobile tonight (and maybe A9 virtualbox if i still have that quirky image saved). |
the tv box is Android 7.1.2.. truthfully, I'd probably still be using my old tv box with Android 4.4 if I could update its System WebView.. |
using conditions of plugged into power and force screen staying on, after half hour and under 150MB for my 90 shows: immediately visible and with watched status but not pins using my LOS A11 mobile. not immediately presenting list of shows until at least switching screens in app from active to archive or log, still no status or pin, using my LOS A13 mobile. my theory was maybe SQLite and/or OS version related, worked with A11 (SQLite 3.28.0) but not A13 (SQLite 3.32.2), see chart and changelogs: after creating the updated db in older device copied and does instant import in new device, only needing to download covers. noted that few shows with differing opinions on season count or which season an episode goes in will match to season and episode number instead of name, so... oh well, close enough for me. |
Today, I ended up writing a migration tool for the command-line.
The README gives some advanced usage instructions,
|
(edit:nvm, TVDB v1 API still broken, after full refresh many other shows broken missing earlier or random seasons! though my most messed up show even restored earlier watched dates after the earlier seasons came back with latest season and extras quadrupled again!) so i guess that doesn't give more time to smooth out the TMDB fork import issues by maybe including specific SQLite library for consistency in app? (though my friends keep mentioning should try something called ai copilot to help modernize code for best practices and catching common mistakes, and something about coworkers using that to program via tabbing auto-complete). |
Just a quick heads up.. Adding support for all languages shouldn't take very long.. The reason that migration uses a locale is that the TMDB v3 API takes a locale parameter.. |
No sure if you mean the locale for synopses but this, but TheTVDB takes a locale parameter, too, and DroidShows allows for per-show setting of the locale. Are you taking this into account in the migration? |
I don't remember.. probably not, since the set of values accepted by one service would need to be mapped onto the set of values accepted by the other. Pretty sure migration in Android just uses the current system locale when it redownloads data for every series in the old db. It uses a localized string resource to map from the Android system locale to a value accepted by the service API. On the command-line, this proposed 3rd parameter would directly specify a value accepted by the service API.. without any mapping. |
That may introduce nasty issues as well, as some shows may have (virtually) no episode listings for one language, but are complete for another. This is why I had introduced the option to set the synopsis language for each show separately. |
tracing through the code..
you're right.. |
sufficed to say.. none of this is fresh in my mind 🤷 |
Ah great! Then there's no trouble there, or at least it's what users would expect. There's a language set for every show, so I don't think a default language would be necessary. |
oh, ok.. I see what the default locale value is used for..
so..
so..
|
after a day's struggle with failed LOS A11 to A12 upgrade, i gave in and formatted data, and have A4T migration test results: confirming same behavior in now LOS A12 mobile as with different LOS A13 mobile device, neither get past adding shows, and since they include the same SQLite version... including the migration working in your A7 (SQLite 3.9.2) device, that is more evidence pointing towards migration should work okay in A4T app up to A11 (SQLite 3.28.0)... but A12+ (SQLite 3.32.2) must have had some breaking https://www.sqlite.org/changes.html since prior versions, and those users will need to use your separate tool for now. |
I'll run a test migration tomorrow on a device with LineageOS 20 (Android 13).. idk if this is in any way related.. |
the most likely culprit is this block of code.. to be perfectly honest, this block of code is entirely unnecessary..
I apologize for this snafu.. |
oh shoot..
so.. I messed up; |
Could you perhaps make a quick release without the UPDATE-FROM code? I know of some people who'd like to migrate, but are on Android 13, so this code is triggered during the migration process. |
will do.. will be done soon |
That's great, thank you! 🙂 |
all set.. v8.0.23 disables that block of code so all versions of Android will run the same migration SQL. I'll revisit whether or not to re-enable this code when a newer version of Android is released that can run it. |
I just tried to migrate my big test database with 320 shows. I'm having a hard time believing it, but during the process, the database operations caused 5.5 GIGAbytes of disk writes and 1.2 GIGAbytes of disk reads. How is this even possible for a database of only 9.5MB? Also, there is a steep decrease in time necessary for show updates: the first shows migrated cost minutes, then it gradually decreases to a second per show. |
I really don't know..
Off-hand, I'd be curious to know..
Maybe it would be more efficient to produce the 2x thumbnails from an image smaller than the full size poster, Since this can now be run on the command-line (and compiles in a few seconds), update: as an added benefit to using the cli.. it's super simple to configure the JRE to tunnel all network requests through an HTTP proxy; I'm using Fiddler (Classic): -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888 |
here are some quick stats.. the attached all of which only have a few episodes.. I ran its migration using the cli tool.. so.. to summarize:
|
I've tried the migration tool. My |
it writes status updates to stdout.. |
I just noticed that myself 😆 In
Should I be worried about these? In |
I noticed those exceptions (MAPPING_FAILED) as well..
then.. the migration:
|
Importing of the new I noticed one minor issue. When viewing a season's list of episodes, german umlauts are not displayed correctly in the episode's name. For example, instead of "ö", I see two chinese? characters. Might be an unicode issue? |
for example, in my test migration (above)..
the TVDB identifier for each series is:
so..
but..
|
In case, that was not your intention: you did not redact your API key in the log above. |
that's interesting..
Can you give me the title to one show that is definitely experiencing this issue? |
Rabbit Hole. S01E03 should be "Die grosse Verschwörung", but shown as "Die grosse Verschw??g" |
it's in the source code.. not a huge secret 🤷 |
the unicode issue must be the result of using the JRE for migration..
so.. since Java isn't my "first language".. |
this SO question (1st one I looked at) has an interesting comment:
|
db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE); public static SQLiteDatabase openDatabase(String dbQname, Object object, int i) throws SQLiteException {
final int res = SQLite.sqlite3_open_v2(dbQname, ppDb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, null);
} https://www.sqlite.org/c3ref/open.html public Pointer prepare(String sql, Object[] makeArgListQueryString) throws SQLiteException {
Pointer pSql = SQLite.nativeString(sql);
} public static Pointer nativeString(String sql) { // TODO Check encoding?
byte[] data = sql.getBytes();
final Pointer pointer = new Memory(data.length + 1);
pointer.write(0, data, 0, data.length);
pointer.setByte(data.length, (byte) 0);
return pointer;
} this looks like the culprit.. |
just a quick check whether the polyfill library where this bug occurs has been fixed after the tagged version being used.. ..no change; |
will be pushing a new release in a few minutes.. huge thanks for reporting that issue! update:
|
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 After importing |
I just released another update.. v1.0.2 It fixes the problem with the TMDB API client.. "Fix" is a bit strong.. The following notes are included mainly for my own future reference…
|
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.
The text was updated successfully, but these errors were encountered: