add navidrome version check for smart playlists

This commit is contained in:
Kendall Garner
2024-02-03 22:47:57 -08:00
parent 46cc1a635f
commit aba7cb302f
11 changed files with 201 additions and 212 deletions
+17
View File
@@ -38,3 +38,20 @@ export const authenticationFailure = (currentServer: ServerListItem | null) => {
useAuthStore.getState().actions.setCurrentServer(null);
}
};
export const hasFeature = (
server: ServerListItem | null,
feature: string,
version = 1,
): boolean => {
if (!server || !server.features) {
return false;
}
const versions = server.features[feature];
if (!versions || versions.length === 0) {
return false;
}
return versions.includes(version);
};