2019-08-11, 13:15
Finally I rescraped all movies and put manually watched state and date in each files
5 hours of works
5 hours of works
(2019-06-22, 08:32)schapplm Wrote:Same problem here on my Android device. Write permissions is not the issue. All addons can write to the internal storage and external (usb) hard drive.(2019-06-05, 17:39)Tobby Wrote: Hi. Every time I run WatchedList on one of my TVs I get this error "WatchedList Error: Doing a database backup (Invalid argument)" and it doesn't create a new backup zip. Is this a known issue? Couldn't find anything in the thread about it.The first one is only the displayed message in Kodi. In the log, you have
In the code for creating the zip file, this error is raised either as ValueError (e.g. "timestamps before 1980") or IOError (e.g. "permission denied"). Can you please check, if you have write permission on the Android device and if you have files with time stamp before 1980?Code:2019-06-05 17:27:41.642 T:9706 ERROR: service.watchedlist: database_backup: Error creating database backup /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.watchedlist/dbcopy/20190605_172741-watchedlist.db.zip: (22) Invalid argument
(2017-12-31, 17:30)schapplm Wrote: The Dropbox authentification mechanism seems to be broken for Android devices. LibreElec seems to be a full linux distribution, but perhaps with a reduced set of python libraries. (I don't use it so I am not sure there).Can you please check, if you can run the zip command in a normal linux terminal on your device?
python
and in the python terminal (with ">>>" on the beginning of the line) enterThis is the code run by the watchedlist addon. Is the zip file created with this code?python:
import zipfile
zipfilename='/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.watchedlist/test.zip'
dbpath='/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.watchedlist/watchedlist.db'
with zipfile.ZipFile(zipfilename, 'w') as zf:
zf.write(dbpath, arcname='watchedlist.db', compress_type=zipfile.ZIP_DEFLATED)
(2019-08-17, 11:27)schapplm Wrote: The backup addon seems to use the same module zipfile, but uses a different method writestr instead of write in my addon. Since my code is only a two-liner, I would prefer to adapt it.Hi @schapplm , I'm not sure if I have enough skills to achieve this, but I''ll give it a try and will let you know my findings.
There were already some python issues with another module on Android devices:
(2017-12-31, 17:30)schapplm Wrote: The Dropbox authentification mechanism seems to be broken for Android devices. LibreElec seems to be a full linux distribution, but perhaps with a reduced set of python libraries. (I don't use it so I am not sure there).Can you please check, if you can run the zip command in a normal linux terminal on your device?
Open a terminal, enterpython
and in the python terminal (with ">>>" on the beginning of the line) enter
This is the code run by the watchedlist addon. Is the zip file created with this code?python:
import zipfile
zipfilename='/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.watchedlist/test.zip'
dbpath='/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.watchedlist/watchedlist.db'
with zipfile.ZipFile(zipfilename, 'w') as zf:
zf.write(dbpath, arcname='watchedlist.db', compress_type=zipfile.ZIP_DEFLATED)
(2019-08-18, 13:04)axbmcuser Wrote: way to make a user friendly "To Watch"-Watchlist[...]Is that something that crossed your mind as additional functionality or separate addon? (Not an easy task and probably too time consuming, just wondering)I also have thought about this issue from time to time.
(2019-08-18, 19:54)schapplm Wrote: Creating a database with unique identifiers from within Kodi (e.g. imdb number) would require scraping the media somehow or obtaining the identifiers on other ways, so this would mostly be suitable for media that is already in the database.I always just thought about a "To Watch List" for items which already are in your KODI movie database. Maybe even just for movies.
(2019-08-18, 19:54)schapplm Wrote: There are already a few solutions for this. E.g., the trakt addon or lists in streaming addons like in the Netflix addon. There is also a "WatchList" addon, but I am not sure what it does.Yes, thats a good idea. I already tried the existing possibilities. "Watchlist" is not a "To Watch List" addon. Had hopes for this one, but nope.
I think you should start a discussion thread on this where you specify your requirements and compare them against existing solutions.
(2019-08-17, 11:27)schapplm Wrote: The backup addon seems to use the same module zipfile, but uses a different method writestr instead of write in my addon. Since my code is only a two-liner, I would prefer to adapt it.Hi,
There were already some python issues with another module on Android devices:
(2017-12-31, 17:30)schapplm Wrote: The Dropbox authentification mechanism seems to be broken for Android devices. LibreElec seems to be a full linux distribution, but perhaps with a reduced set of python libraries. (I don't use it so I am not sure there).Can you please check, if you can run the zip command in a normal linux terminal on your device?
Open a terminal, enterpython
and in the python terminal (with ">>>" on the beginning of the line) enter
This is the code run by the watchedlist addon. Is the zip file created with this code?python:
import zipfile
zipfilename='/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.watchedlist/test.zip'
dbpath='/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.watchedlist/watchedlist.db'
with zipfile.ZipFile(zipfilename, 'w') as zf:
zf.write(dbpath, arcname='watchedlist.db', compress_type=zipfile.ZIP_DEFLATED)
(2019-04-17, 21:40)HeresJohnny Wrote: I would like to add some observations related to the imdb ID.
[...] Unfortunately, the default scrapers in Kodi for movies and tv shows are now set to TMDB. As I already commented in the TMDB scraper thread, items which are scraped with that scraper have existing IMDB nos. forcibly removed and only the TMDB no. is added/kept in the db. The Universal Movie scraper on the other hand doesn't add the TMDB ID.
Karellen Wrote: "TheMovieDB-TVShows" replaced "TheTVDB" as the default scraper during Nov 2018. If you originally scraped with TVDB and are now rebuilding your library with NFO Files, ensure the correct scraper is active.
Fields: internal number of tv show, reference to uniqueid, type of id, id of the provider, titlesql:SELECT tvshow.idShow,tvshow.c12, uniqueid.type, uniqueid.value, tvshow.c00 FROM tvshow INNER JOIN uniqueid ON tvshow.c12 = uniqueid.uniqueid_id;
169 22829 tmdb 60741 Ascension
170 22896 unknown 247897 Homeland
171 23551 unknown 121361 Game of Thrones
172 23588 tvdb 71663 Die Simpsons
http://localhost:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties": ["title", "imdbnumber", "uniqueid"], "sort": { "order": "ascending", "method": "title" } }, "id": 1}
The key `idShow` in the tvshows table of the WatchedList database was only referring to the field `imdbnumber` of the JSON output, which from retroperspective is not a good choice for a unique identifier of watched status. It might be that I started with API version 4 instead of version 6, where the field uniqueid was introduced.json:{"imdbnumber":"10283","label":"Archer","title":"Archer","tvshowid":164,"uniqueid":{"tmdb":"10283","tvdb":"110381"}}
(2019-04-18, 06:36)schapplm Wrote: As for the tv shows I also support this to be done on scraper/database/json-API-level.I have to think about a solution how to fix it at the end of this addon, since the data is now duplicate and old data can not be used. Creating an automatic upgrade mechanism of the table will take time, however.
(2019-08-24, 16:01)schapplm Wrote: The last line "zf.write..." has to be preceeded by two or four whitespaces ("indentation"). Unfortunately the code was not displayed correctly at first in my post.Can you edit your post and provide the correct code please? I prefer to copy and paste the code, instead of typing it.
(2019-08-24, 22:27)HeresJohnny Wrote: In the end, the IMDB ID might even be used as a central value to avoid having to rescrape complete TV shows to change from TMDB to TheTVDB or vice versa. In the worst of cases, user could be asked for a IMDB ID while scraping when ambiguities are found.My approach would be to just use `uniqueid.tmdb` instead of `imdbnumber` as can be seen in the JSON output. (Keep in mind that `imdbnumber` is just the name of the field and does not refer to imdb ...). Instead of course uniqueid.imdb could be used. But this has to be created by the scraper, which is not the case at the moment. I asked in the tmdb thread for advice how to proceed in that matter.