A couple more ignored article fixes
This commit is contained in:
@@ -642,12 +642,14 @@ class SubsonicAdapter(Adapter):
|
|||||||
try:
|
try:
|
||||||
# If we already got the ignored articles from the get_artists, do that here.
|
# If we already got the ignored articles from the get_artists, do that here.
|
||||||
with open(self.ignored_articles_cache_file, "rb+") as f:
|
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:
|
except Exception:
|
||||||
try:
|
try:
|
||||||
# Whatever the exception, fall back on getting from the server.
|
# Whatever the exception, fall back on getting from the server.
|
||||||
if artists := self._get_json(self._make_url("getArtists")).artists:
|
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:
|
except Exception:
|
||||||
# Use the default ignored articles.
|
# Use the default ignored articles.
|
||||||
pass
|
pass
|
||||||
|
@@ -284,7 +284,7 @@ class IndexID3:
|
|||||||
@dataclass_json(letter_case=LetterCase.CAMEL)
|
@dataclass_json(letter_case=LetterCase.CAMEL)
|
||||||
@dataclass
|
@dataclass
|
||||||
class ArtistsID3:
|
class ArtistsID3:
|
||||||
ignored_articles: str
|
ignored_articles: Optional[str] = None
|
||||||
index: List[IndexID3] = field(default_factory=list)
|
index: List[IndexID3] = field(default_factory=list)
|
||||||
|
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ class Genres:
|
|||||||
@dataclass_json(letter_case=LetterCase.CAMEL)
|
@dataclass_json(letter_case=LetterCase.CAMEL)
|
||||||
@dataclass
|
@dataclass
|
||||||
class Indexes:
|
class Indexes:
|
||||||
ignored_articles: str
|
ignored_articles: Optional[str] = None
|
||||||
index: List[Index] = field(default_factory=list)
|
index: List[Index] = field(default_factory=list)
|
||||||
|
|
||||||
|
|
||||||
|
67
tests/adapter_tests/mock_data/get_artists-supysonic.json
Normal file
67
tests/adapter_tests/mock_data/get_artists-supysonic.json
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user