mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 05:20:13 +02:00
feat: Add explicit status for Navidrome and OpenSubsonic (#1220)
* add navidrome explicit status * add ExplicitStatus enum and support opensubsonic * add explicit status to cards
This commit is contained in:
@@ -7,6 +7,7 @@ import { ssType } from '/@/shared/api/subsonic/subsonic-types';
|
||||
import {
|
||||
Album,
|
||||
AlbumArtist,
|
||||
ExplicitStatus,
|
||||
Genre,
|
||||
LibraryItem,
|
||||
Playlist,
|
||||
@@ -164,6 +165,12 @@ const normalizeSong = (
|
||||
discNumber: item.discNumber,
|
||||
discSubtitle: item.discSubtitle ? item.discSubtitle : null,
|
||||
duration: item.duration * 1000,
|
||||
explicitStatus:
|
||||
item.explicitStatus === 'e'
|
||||
? ExplicitStatus.EXPLICIT
|
||||
: item.explicitStatus === 'c'
|
||||
? ExplicitStatus.CLEAN
|
||||
: null,
|
||||
gain:
|
||||
item.rgAlbumGain || item.rgTrackGain
|
||||
? { album: item.rgAlbumGain, track: item.rgTrackGain }
|
||||
@@ -237,6 +244,12 @@ const normalizeAlbum = (
|
||||
comment: item.comment || null,
|
||||
createdAt: item.createdAt.split('T')[0],
|
||||
duration: item.duration !== undefined ? item.duration * 1000 : null,
|
||||
explicitStatus:
|
||||
item.explicitStatus === 'e'
|
||||
? ExplicitStatus.EXPLICIT
|
||||
: item.explicitStatus === 'c'
|
||||
? ExplicitStatus.CLEAN
|
||||
: null,
|
||||
genres: (item.genres || []).map((genre) => ({
|
||||
id: genre.id,
|
||||
imageUrl: null,
|
||||
|
||||
@@ -134,6 +134,7 @@ const album = z.object({
|
||||
coverArtPath: z.string().optional(), // Removed after v0.48.0
|
||||
createdAt: z.string(),
|
||||
duration: z.number().optional(),
|
||||
explicitStatus: z.string().optional(),
|
||||
fullText: z.string(),
|
||||
genre: z.string(),
|
||||
genres: z.array(genre).nullable(),
|
||||
@@ -200,6 +201,7 @@ const song = z.object({
|
||||
discSubtitle: z.string().optional(),
|
||||
duration: z.number(),
|
||||
embedArtPath: z.string().optional(),
|
||||
explicitStatus: z.string().optional(),
|
||||
externalInfoUpdatedAt: z.string().optional(),
|
||||
externalUrl: z.string().optional(),
|
||||
fullText: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user