mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
fix all imports for new structure
This commit is contained in:
parent
249eaf89f8
commit
930165d006
291 changed files with 2056 additions and 1894 deletions
|
|
@ -269,7 +269,7 @@ const normalizeAlbum = (
|
|||
(item as z.infer<typeof ssType._response.album>).song?.map((song) =>
|
||||
normalizeSong(song, server),
|
||||
) || [],
|
||||
tags: item.tags || null,
|
||||
tags: null,
|
||||
uniqueId: nanoid(),
|
||||
updatedAt: item.created,
|
||||
userFavorite: item.starred || false,
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ import reverse from 'lodash/reverse';
|
|||
import shuffle from 'lodash/shuffle';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { jfType } from '../../renderer/api/jellyfin/jellyfin-types';
|
||||
import { ndType } from '../api/navidrome/navidrome-types';
|
||||
import {
|
||||
JFAlbumArtistListSort,
|
||||
JFAlbumListSort,
|
||||
|
|
@ -13,7 +11,8 @@ import {
|
|||
JFPlaylistListSort,
|
||||
JFSongListSort,
|
||||
JFSortOrder,
|
||||
} from '../renderer/api/jellyfin.types';
|
||||
} from '/@/shared/api/jellyfin.types';
|
||||
import { jfType } from '/@/shared/api/jellyfin/jellyfin-types';
|
||||
import {
|
||||
NDAlbumArtistListSort,
|
||||
NDAlbumListSort,
|
||||
|
|
@ -23,8 +22,10 @@ import {
|
|||
NDSongListSort,
|
||||
NDSortOrder,
|
||||
NDUserListSort,
|
||||
} from '../renderer/api/navidrome.types';
|
||||
import { ServerFeatures } from './features-types';
|
||||
} from '/@/shared/api/navidrome.types';
|
||||
import { ndType } from '/@/shared/api/navidrome/navidrome-types';
|
||||
import { ServerFeatures } from '/@/shared/types/features-types';
|
||||
import { PlayerStatus } from '/@/shared/types/types';
|
||||
|
||||
export enum LibraryItem {
|
||||
ALBUM = 'album',
|
||||
|
|
@ -56,6 +57,28 @@ export type AnyLibraryItems =
|
|||
| QueueSong[]
|
||||
| Song[];
|
||||
|
||||
export interface PlayerData {
|
||||
current: {
|
||||
index: number;
|
||||
nextIndex?: number;
|
||||
player: 1 | 2;
|
||||
previousIndex?: number;
|
||||
shuffledIndex: number;
|
||||
song?: QueueSong;
|
||||
status: PlayerStatus;
|
||||
};
|
||||
player1?: QueueSong;
|
||||
player2?: QueueSong;
|
||||
queue: QueueData;
|
||||
}
|
||||
|
||||
export interface QueueData {
|
||||
current?: QueueSong;
|
||||
length: number;
|
||||
next?: QueueSong;
|
||||
previous?: QueueSong;
|
||||
}
|
||||
|
||||
export type QueueSong = Song & {
|
||||
uniqueId: string;
|
||||
};
|
||||
|
|
@ -1482,3 +1505,7 @@ export const sortAlbumArtistList = (
|
|||
|
||||
return results;
|
||||
};
|
||||
export enum AppTheme {
|
||||
DEFAULT_DARK = 'defaultDark',
|
||||
DEFAULT_LIGHT = 'defaultLight',
|
||||
}
|
||||
|
|
|
|||
113
src/shared/types/remote-types.ts
Normal file
113
src/shared/types/remote-types.ts
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
import { QueueSong } from '/@/shared/types/domain-types';
|
||||
import { PlayerRepeat, PlayerStatus, SongState } from '/@/shared/types/types';
|
||||
|
||||
export interface ClientAuth {
|
||||
event: 'authenticate';
|
||||
header: string;
|
||||
}
|
||||
|
||||
export type ClientEvent =
|
||||
| ClientAuth
|
||||
| ClientFavorite
|
||||
| ClientPosition
|
||||
| ClientRating
|
||||
| ClientSimpleEvent
|
||||
| ClientVolume;
|
||||
|
||||
export interface ClientFavorite {
|
||||
event: 'favorite';
|
||||
favorite: boolean;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ClientPosition {
|
||||
event: 'position';
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface ClientRating {
|
||||
event: 'rating';
|
||||
id: string;
|
||||
rating: number;
|
||||
}
|
||||
export interface ClientSimpleEvent {
|
||||
event: 'next' | 'pause' | 'play' | 'previous' | 'proxy' | 'repeat' | 'shuffle';
|
||||
}
|
||||
|
||||
export interface ClientVolume {
|
||||
event: 'volume';
|
||||
volume: number;
|
||||
}
|
||||
|
||||
export interface ServerError {
|
||||
data: string;
|
||||
event: 'error';
|
||||
}
|
||||
|
||||
export type ServerEvent =
|
||||
| ServerError
|
||||
| ServerFavorite
|
||||
| ServerPlayStatus
|
||||
| ServerPosition
|
||||
| ServerProxy
|
||||
| ServerRating
|
||||
| ServerRepeat
|
||||
| ServerShuffle
|
||||
| ServerSong
|
||||
| ServerState
|
||||
| ServerVolume;
|
||||
|
||||
export interface ServerFavorite {
|
||||
data: { favorite: boolean; id: string };
|
||||
event: 'favorite';
|
||||
}
|
||||
|
||||
export interface ServerPlayStatus {
|
||||
data: PlayerStatus;
|
||||
event: 'playback';
|
||||
}
|
||||
|
||||
export interface ServerPosition {
|
||||
data: number;
|
||||
event: 'position';
|
||||
}
|
||||
|
||||
export interface ServerProxy {
|
||||
data: string;
|
||||
event: 'proxy';
|
||||
}
|
||||
|
||||
export interface ServerRating {
|
||||
data: { id: string; rating: number };
|
||||
event: 'rating';
|
||||
}
|
||||
|
||||
export interface ServerRepeat {
|
||||
data: PlayerRepeat;
|
||||
event: 'repeat';
|
||||
}
|
||||
|
||||
export interface ServerShuffle {
|
||||
data: boolean;
|
||||
event: 'shuffle';
|
||||
}
|
||||
|
||||
export interface ServerSong {
|
||||
data: null | QueueSong;
|
||||
event: 'song';
|
||||
}
|
||||
|
||||
export interface ServerState {
|
||||
data: SongState;
|
||||
event: 'state';
|
||||
}
|
||||
|
||||
export interface ServerVolume {
|
||||
data: number;
|
||||
event: 'volume';
|
||||
}
|
||||
|
||||
export interface SongUpdateSocket extends Omit<SongState, 'song'> {
|
||||
position?: number;
|
||||
song?: null | QueueSong;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue