Verified Commit 6452cf10 authored by Sumner Evans's avatar Sumner Evans 💬

A couple more ignored article fixes

parent 734e21bd
Pipeline #210191484 passed with stages
in 26 minutes and 36 seconds
......@@ -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
......
......@@ -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)
......
{
"subsonic-response": {
"status": "ok",
"version": "1.15.0",
"artists": {
"index": [
{
"name": "A",
"artist": [
{
"id": "102",
"name": "Adele",
"coverArt": "ar-102",
"albumCount": 1
},
{
"id": "122",
"name": "Austin French",
"coverArt": "ar-122",
"albumCount": 1
},
{
"id": "75",
"name": "The Afters",
"coverArt": "ar-75",
"albumCount": 2
}
]
},
{
"name": "B",
"artist": [
{
"id": "95",
"name": "The Band Perry",
"coverArt": "ar-95",
"albumCount": 1
},
{
"id": "41",
"name": "Basshunter",
"coverArt": "ar-41",
"albumCount": 1
}
]
},
{
"name": "X-Z",
"artist": [
{
"id": "154",
"name": "Zac Brown Band",
"coverArt": "ar-154",
"albumCount": 3
},
{
"id": "25",
"name": "Zach Williams",
"coverArt": "ar-25",
"albumCount": 1
}
]
}
]
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment