A couple more ignored article fixes

This commit is contained in:
Sumner Evans
2020-10-23 22:00:43 -06:00
parent 734e21bda7
commit 6452cf1092
3 changed files with 73 additions and 4 deletions

View File

@@ -642,12 +642,14 @@ class SubsonicAdapter(Adapter):
try:
# If we already got the ignored articles from the get_artists, do that here.
with open(self.ignored_articles_cache_file, "rb+") as f:
ignored_articles = pickle.load(f)
if ia := pickle.load(f):
ignored_articles = ia
except Exception:
try:
# Whatever the exception, fall back on getting from the server.
if artists := self._get_json(self._make_url("getArtists")).artists:
ignored_articles = artists.ignored_articles
if ia := artists.ignored_articles:
ignored_articles = ia
except Exception:
# Use the default ignored articles.
pass

View File

@@ -284,7 +284,7 @@ class IndexID3:
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass
class ArtistsID3:
ignored_articles: str
ignored_articles: Optional[str] = None
index: List[IndexID3] = field(default_factory=list)
@@ -303,7 +303,7 @@ class Genres:
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass
class Indexes:
ignored_articles: str
ignored_articles: Optional[str] = None
index: List[Index] = field(default_factory=list)