The main core of this code was lifted from Trakt code and not developed enough to be suitable for purpose given that the Trakt code isn't fully developed either. An issue found leading to this decision was that show statuses were set false instead of the expected default, however, worse was that users had no way of choosing shows to add, was not informed of what was actually going on once a URL was added to the UI, and was not offered options prior to adding shows like the normal add new show work-flow does. Basically, there are too many issues and this feature is too immature for inclusion.
Used regex checks with javascript popup, for checking if valid imdb csv watchlist.
Added test/test_tvdb_api.py for testing the tvdb api for retrieving shows by IMDB id.
TODO: Help for assisting users in getting the correct IMDB url.
maybe, make interval configurable
First changes for imdb watchlist checker
Thrown the couch code overboard and created my own version of an imdb watchlist scraper
Added IMDB thread and test values with an IMDB csv url. These values should be replaced by front end UI settings.
- Removed some tracelogs when unable to download watchlist
- Added settings for enabling and setting of the watchlist csv url
TODO:
- create UI for setting from frontend
- Implement frontend and backend checks for validating the csv url
Default interval is 1 hour.
Added full delete feature to mass update, removes show from SR and deletes show folder from hard drive. Remove will just delete show from SR without deleting files from hard drive
Fixed XML errors for TVRage indexer api
Bugfix by viperidae
Reference:
---------------
Reference: https://sickrage.tv/forums/forum/help-support/bug-issue-reports/6224-there-was-an-error-with-the-xml-retrieved-from-tvrage-com
Quote:
----------
Had a look at the code and the xml documents...
It looks like the problem is caused by an empty <genre /> element in Results/shows/show/genres/
Line 459 of tvrage_api.py (it's 460 in my track in the previous post because of the debug statements I put in)
I assume it's because value is NoneType, gets replaced by a [NoneType] list and then tries to call '|'.join([NoneType]) when it was expecting a list of strings.
I changed this to the following and the problem appears to be resolved
Syslog extract:
----------------------
tvrage_error: There was an error with the XML retrieved from tvrage.com
First try emptying the cache folder at..
C:\Users\Josh\Documents\Programs\SickRage\cache\indexers\TVRage
If this does not resolve the issue, please try again later. If the error persists, report a bug on
2014-08-09 00:43:25 INFO SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: Searching for episodes we need from Top Gear Season 21
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: cache.db: SELECT * FROM [nmatrix] WHERE indexerid = ? AND season = ? AND episodes LIKE ? with args [74608, 21, '%|2|%']
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: cache.db: UPDATE lastSearch SET time = ? WHERE provider = ? with args [1407559405, 'nmatrix']
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: cache.db: INSERT INTO lastSearch (time, provider) VALUES (?, ?) with args [1407559405, 'nmatrix']
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: sickbeard.db: SELECT * FROM indexer_mapping WHERE indexer_id = ? AND indexer = ? with args [74608, 1]
2014-08-09 00:43:25 ERROR SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: Error while searching NMatrix, skipping: There was an error with the XML retrieved from tvrage.com
First try emptying the cache folder at..
C:\Users\Josh\Documents\Programs\SickRage\cache\indexers\TVRage
If this does not resolve the issue, please try again later. If the error persists, report a bug on
2014-08-09 00:43:25 DEBUG SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: Traceback (most recent call last):
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\search.py", line 428, in searchProviders
searchResults = curProvider.findSearchResults(show, season, episodes, search_mode, manualSearch)
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\providers\generic.py", line 264, in findSearchResults
for curString in self._get_episode_search_strings(epObj):
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\providers\newznab.py", line 133, in _get_episode_search_strings
rid = helpers.mapIndexersToShow(ep_obj.show)[2]
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\helpers.py", line 1178, in mapIndexersToShow
mapped_show = t[showObj.name]
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 675, in __getitem__
selected_series = self._getSeries(key)
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 566, in _getSeries
allSeries = self.search(series)
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 557, in search
seriesEt = self._getetsrc(self.config['url_getSeries'], self.config['params_getSeries'])
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 500, in _getetsrc
raise tvrage_error(errormsg)
Fixed issues with indexerApi caching code, seemed TVRage was really the only one experiancing the problems but has been corrected for theTVDB just in case.
Git updates are now forced to overwrite locale changes to avoid needing to manually stash uncommited changes before being able to proceed with a update.
Fixed indexer mapping when unable to locate show on indexer that we are trying to map to.
Provider getURL and downloadResult functions now removed and replaced with ones from helpers.py to help slim the code down plus allow more better control over request sessions.
Removed TVTumbler code.
Fixed HDBits provider.
Fixed config settings that were ment to be booleans but instead where set as str or int, should help resolve random html errors.
XEM Refresh check re-coded.
NameParser code for creating show object has been changed to only attempt at the very end once its found the bestMatch result, helps on resources and performance.
Indexer mapping now uses indexer api calls to gather its information and then stores it to a new table called indexer_mapping for instant lookups later on.
Fixed trakt related issues for adding new shows and syncing.
Centered items at bottom of pages to just look a little nicer and fit properly.
Fixed charmap issues for anime show names.
Fixed issues with display show page and epCat key errors.
Fixed duplicate log messages for clearing provider caches.
Fixed issues with email notifier ep names not properly being encoded to UTF-8.
TVDB<->TVRAGE Indexer ID mapping is now performed on demand to be used when needed such as newznab providers can be searched with tvrage_id's and some will return tvrage_id's that later can be used to create show objects from for faster and more accurate name parsing, mapping is done via Trakt API calls.
Added stop event signals to schedualed tasks, SR now waits indefinate till task has been fully stopped before completing a restart or shutdown event.
NameParserCache is now persistent and stores 200 parsed results at any given time for quicker lookups and better performance, this helps maintain results between updates or shutdown/startup events.
Black and White lists for anime now only get used for anime shows as intended, performance gain for non-anime shows that dont need to load these lists.
Internal name cache now builds it self on demand when needed per show request plus checks if show is already in cache and if true exits routine to save time.
Schedualer and QueueItems classes are now a sub-class of threading.Thread and a stop threading event signal has been added to each.
If I forgot to list something it doesn't mean its not fixed so please test and report back if anything is wrong or has been corrected by this new release.