Ability to get albums by genre

This commit is contained in:
simojenki
2021-03-20 10:05:31 +11:00
parent 0e3fd9d781
commit 8f5905c16f
2 changed files with 70 additions and 4 deletions

View File

@@ -530,7 +530,18 @@ function bindSmapiSoapServiceToExpress(
total,
});
});
default:
case "genre":
return await musicLibrary.albums({ ...paging, genre: typeId }).then((result) => {
const accessToken = accessTokens.mint(authToken);
return getMetadataResult({
mediaCollection: result.results.map((it) =>
album(webAddress, accessToken, it)
),
index: paging._index,
total: result.total,
});
});
default:
throw `Unsupported id:${id}`;
}
},