fix(music): complete subscription lifecycle

This commit is contained in:
jxxghp
2026-08-10 07:21:06 +08:00
parent 12b054c316
commit 1fc255b8a7
24 changed files with 789 additions and 131 deletions
+8 -1
View File
@@ -9,6 +9,7 @@ from requests import Response
from app import schemas
from app.core.config import settings
from app.helper.mediaserver import MusicMediaServerHelper
from app.log import logger
from app.schemas import MediaServerItem
from app.schemas.types import MediaType
@@ -434,6 +435,8 @@ class Emby:
url = f"{self._host}emby/Users/{self.user}/Items"
params = {
"IncludeItemTypes": "MusicAlbum,Audio",
"Fields": "Album,AlbumArtist,AlbumArtists,Artists,ArtistItems,ChildCount,"
"ProviderIds,OriginalTitle,ProductionYear,Path,ParentId",
"SearchTerm": query,
"Recursive": "true",
"Limit": 20,
@@ -747,6 +750,8 @@ class Emby:
imdbid=item.get("ProviderIds", {}).get("Imdb"),
tvdbid=item.get("ProviderIds", {}).get("Tvdb"),
path=item.get("Path"),
note=MusicMediaServerHelper.build_note(item)
if item.get("Type") in {"MusicAlbum", "Audio"} else None,
user_state=user_state
)
@@ -819,7 +824,9 @@ class Emby:
params = {
"ParentId": parent,
"api_key": self._apikey,
"Fields": "ProviderIds,OriginalTitle,ProductionYear,Path,UserDataPlayCount,UserDataLastPlayedDate,ParentId"
"Fields": "Album,AlbumArtist,AlbumArtists,Artists,ArtistItems,ChildCount,"
"ProviderIds,OriginalTitle,ProductionYear,Path,UserDataPlayCount,"
"UserDataLastPlayedDate,ParentId"
}
if limit is not None and limit != -1:
params.update({