Fix theme songs with disabled theme videos

This commit is contained in:
Dmitry Lyzo 2022-03-12 22:48:00 +03:00
parent 7842eef4a6
commit 3909398dc3

View File

@ -72,12 +72,12 @@ function loadThemeMedia(item) {
const apiClient = ServerConnections.getApiClient(item.ServerId); const apiClient = ServerConnections.getApiClient(item.ServerId);
apiClient.getThemeMedia(apiClient.getCurrentUserId(), item.Id, true).then(function (themeMediaResult) { apiClient.getThemeMedia(apiClient.getCurrentUserId(), item.Id, true).then(function (themeMediaResult) {
const ownerId = themeMediaResult.ThemeVideosResult.Items.length ? themeMediaResult.ThemeVideosResult.OwnerId : themeMediaResult.ThemeSongsResult.OwnerId; const result = userSettings.enableThemeVideos() && themeMediaResult.ThemeVideosResult.Items.length ? themeMediaResult.ThemeVideosResult : themeMediaResult.ThemeSongsResult;
const ownerId = result.OwnerId;
if (ownerId !== currentOwnerId) { if (ownerId !== currentOwnerId) {
const items = themeMediaResult.ThemeVideosResult.Items.length ? themeMediaResult.ThemeVideosResult.Items : themeMediaResult.ThemeSongsResult.Items; playThemeMedia(result.Items, ownerId);
playThemeMedia(items, ownerId);
} }
}); });
} }