Update watch.py

master
Iggy 2020-10-15 21:05:34 +01:00 committed by GitHub
parent 806df86d11
commit 87596b31cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,5 @@
from anime_downloader import config from anime_downloader import config
from anime_downloader.sites import get_anime_class from anime_downloader.sites import get_anime_class, ALL_ANIME_SITES
import os import os
import sys import sys
@ -195,11 +195,10 @@ class Watcher:
logger.warn(f"The url: {url} is no longer supported. The provider needs to be set manually upon selection.") logger.warn(f"The url: {url} is no longer supported. The provider needs to be set manually upon selection.")
""" """
Literally the only way to make sure the watch list doesn't fail when people delete providers from ALL_ANIME_SITES. Provides some level of backcompatability when watch lists have providers that have been removed. They are then warned via logger that they will
If nyaa needs to go, change this to another website. The other alternative is to make a invalidURL provider. However, that causes issues have to change providers using the set function when an anime is selected in the list.
in that the user will theoretically be able to choose invalidURL as a provider. Honestly, this is a stupid way to provide backcompatability...
""" """
url = "https://nyaa.si" url = ALL_ANIME_SITES[0][1]
cls = get_anime_class(url) cls = get_anime_class(url)
# TODO: Maybe this is better off as a mixin # TODO: Maybe this is better off as a mixin