fix imports

This commit is contained in:
jeffvli
2025-07-07 21:11:27 -07:00
parent 1c22461ee4
commit a3a67d20a9
18 changed files with 48 additions and 165 deletions
+2 -2
View File
@@ -11,8 +11,8 @@ import manifest from './manifest.json';
import { getMainWindow } from '/@/main/index'; import { getMainWindow } from '/@/main/index';
import { isLinux } from '/@/main/utils'; import { isLinux } from '/@/main/utils';
import { QueueSong } from '/@/shared/types/domain-types'; import { QueueSong } from '/@/shared/types/domain/player-domain-types';
import { ClientEvent, ServerEvent } from '/@/shared/types/remote-types'; import { ClientEvent, ServerEvent } from '/@/shared/types/domain/remote-types';
import { PlayerRepeat, PlayerStatus, SongState } from '/@/shared/types/types'; import { PlayerRepeat, PlayerStatus, SongState } from '/@/shared/types/types';
let mprisPlayer: any | undefined; let mprisPlayer: any | undefined;
+1 -1
View File
@@ -2,7 +2,7 @@ import { ipcMain } from 'electron';
import Player from 'mpris-service'; import Player from 'mpris-service';
import { getMainWindow } from '/@/main/index'; import { getMainWindow } from '/@/main/index';
import { QueueSong } from '/@/shared/types/domain-types'; import { QueueSong } from '/@/shared/types/domain/player-domain-types';
import { PlayerRepeat, PlayerStatus } from '/@/shared/types/types'; import { PlayerRepeat, PlayerStatus } from '/@/shared/types/types';
const mprisPlayer = Player({ const mprisPlayer = Player({
+1 -1
View File
@@ -7,7 +7,7 @@ import {
LyricSource, LyricSource,
} from '../main/features/core/lyrics'; } from '../main/features/core/lyrics';
import { QueueSong } from '/@/shared/types/domain-types'; import { QueueSong } from '/@/shared/types/domain/player-domain-types';
const getRemoteLyricsBySong = (song: QueueSong) => { const getRemoteLyricsBySong = (song: QueueSong) => {
const result = ipcRenderer.invoke('lyric-by-song', song); const result = ipcRenderer.invoke('lyric-by-song', song);
+1 -1
View File
@@ -1,6 +1,6 @@
import { ipcRenderer, IpcRendererEvent } from 'electron'; import { ipcRenderer, IpcRendererEvent } from 'electron';
import { PlayerData } from '/@/shared/types/domain-types'; import { PlayerData } from '/@/shared/types/domain/player-domain-types';
const initialize = (data: { extraParameters?: string[]; properties?: Record<string, any> }) => { const initialize = (data: { extraParameters?: string[]; properties?: Record<string, any> }) => {
return ipcRenderer.invoke('player-initialize', data); return ipcRenderer.invoke('player-initialize', data);
+1 -1
View File
@@ -1,6 +1,6 @@
import { ipcRenderer, IpcRendererEvent } from 'electron'; import { ipcRenderer, IpcRendererEvent } from 'electron';
import { QueueSong } from '/@/shared/types/domain-types'; import { QueueSong, QueueSong } from '/@/shared/types/domain/player-domain-types';
import { PlayerStatus } from '/@/shared/types/types'; import { PlayerStatus } from '/@/shared/types/types';
const requestFavorite = ( const requestFavorite = (
+1 -1
View File
@@ -11,7 +11,7 @@ import { authenticationFailure } from '/@/renderer/api/utils';
import { useAuthStore } from '/@/renderer/store'; import { useAuthStore } from '/@/renderer/store';
import { jfType } from '/@/shared/api/jellyfin/jellyfin-types'; import { jfType } from '/@/shared/api/jellyfin/jellyfin-types';
import { getClientType } from '/@/shared/api/utils'; import { getClientType } from '/@/shared/api/utils';
import { ServerListItem } from '/@/shared/types/domain-types'; import { ServerListItem } from '/@/shared/types/domain/server-domain-types';
const c = initContract(); const c = initContract();
@@ -6,19 +6,15 @@ import { JFSongListSort, JFSortOrder } from '/@/shared/api/jellyfin.types';
import { jfNormalize } from '/@/shared/api/jellyfin/jellyfin-normalize'; import { jfNormalize } from '/@/shared/api/jellyfin/jellyfin-normalize';
import { jfType } from '/@/shared/api/jellyfin/jellyfin-types'; import { jfType } from '/@/shared/api/jellyfin/jellyfin-types';
import { getFeatures, hasFeature, VersionInfo } from '/@/shared/api/utils'; import { getFeatures, hasFeature, VersionInfo } from '/@/shared/api/utils';
import { import { albumListSortMap } from '/@/shared/types/domain/album-domain-types';
albumArtistListSortMap, import { ControllerEndpoint } from '/@/shared/types/domain/api-domain-types';
albumListSortMap, import { albumArtistListSortMap } from '/@/shared/types/domain/artist-domain-types';
ControllerEndpoint, import { genreListSortMap } from '/@/shared/types/domain/genre-domain-types';
genreListSortMap, import { Played } from '/@/shared/types/domain/player-domain-types';
LibraryItem, import { playlistListSortMap } from '/@/shared/types/domain/playlist-domain-types';
Played, import { ServerFeature } from '/@/shared/types/domain/server-domain-types';
playlistListSortMap, import { LibraryItem, sortOrderMap } from '/@/shared/types/domain/shared-domain-types';
Song, import { Song, songListSortMap } from '/@/shared/types/domain/song-domain-types';
songListSortMap,
sortOrderMap,
} from '/@/shared/types/domain-types';
import { ServerFeature } from '/@/shared/types/features-types';
const formatCommaDelimitedString = (value: string[]) => { const formatCommaDelimitedString = (value: string[]) => {
return value.join(','); return value.join(',');
+1 -1
View File
@@ -11,7 +11,7 @@ import { useAuthStore } from '/@/renderer/store';
import { ndType } from '/@/shared/api/navidrome/navidrome-types'; import { ndType } from '/@/shared/api/navidrome/navidrome-types';
import { resultWithHeaders } from '/@/shared/api/utils'; import { resultWithHeaders } from '/@/shared/api/utils';
import { toast } from '/@/shared/components/toast/toast'; import { toast } from '/@/shared/components/toast/toast';
import { ServerListItem } from '/@/shared/types/domain-types'; import { ServerListItem } from '/@/shared/types/domain/server-domain-types';
const localSettings = isElectron() ? window.api.localSettings : null; const localSettings = isElectron() ? window.api.localSettings : null;
@@ -7,22 +7,24 @@ import { ndType } from '/@/shared/api/navidrome/navidrome-types';
import { ssNormalize } from '/@/shared/api/subsonic/subsonic-normalize'; import { ssNormalize } from '/@/shared/api/subsonic/subsonic-normalize';
import { SubsonicExtensions } from '/@/shared/api/subsonic/subsonic-types'; import { SubsonicExtensions } from '/@/shared/api/subsonic/subsonic-types';
import { getFeatures, hasFeature, VersionInfo } from '/@/shared/api/utils'; import { getFeatures, hasFeature, VersionInfo } from '/@/shared/api/utils';
import { albumListSortMap } from '/@/shared/types/domain/album-domain-types';
import { ControllerEndpoint } from '/@/shared/types/domain/api-domain-types';
import { albumArtistListSortMap } from '/@/shared/types/domain/artist-domain-types';
import { AuthenticationResponse } from '/@/shared/types/domain/auth-domain-types';
import { genreListSortMap } from '/@/shared/types/domain/genre-domain-types';
import { import {
albumArtistListSortMap,
albumListSortMap,
AuthenticationResponse,
ControllerEndpoint,
genreListSortMap,
playlistListSortMap, playlistListSortMap,
PlaylistSongListArgs, PlaylistSongListArgs,
PlaylistSongListResponse, PlaylistSongListResponse,
} from '/@/shared/types/domain/playlist-domain-types';
import {
ServerFeature,
ServerFeatures,
ServerListItem, ServerListItem,
Song, } from '/@/shared/types/domain/server-domain-types';
songListSortMap, import { sortOrderMap } from '/@/shared/types/domain/shared-domain-types';
sortOrderMap, import { Song, songListSortMap } from '/@/shared/types/domain/song-domain-types';
userListSortMap, import { userListSortMap } from '/@/shared/types/domain/user-domain-types';
} from '/@/shared/types/domain-types';
import { ServerFeature, ServerFeatures } from '/@/shared/types/features-types';
const VERSION_INFO: VersionInfo = [ const VERSION_INFO: VersionInfo = [
['0.55.0', { [ServerFeature.BFR]: [1] }], ['0.55.0', { [ServerFeature.BFR]: [1] }],
+1 -1
View File
@@ -7,7 +7,7 @@ import { z } from 'zod';
import i18n from '/@/i18n/i18n'; import i18n from '/@/i18n/i18n';
import { ssType } from '/@/shared/api/subsonic/subsonic-types'; import { ssType } from '/@/shared/api/subsonic/subsonic-types';
import { toast } from '/@/shared/components/toast/toast'; import { toast } from '/@/shared/components/toast/toast';
import { ServerListItem } from '/@/shared/types/domain-types'; import { ServerListItem } from '/@/shared/types/domain/server-domain-types';
const c = initContract(); const c = initContract();
@@ -14,19 +14,14 @@ import {
ssType, ssType,
SubsonicExtensions, SubsonicExtensions,
} from '/@/shared/api/subsonic/subsonic-types'; } from '/@/shared/api/subsonic/subsonic-types';
import { import { AlbumListSort, sortAlbumList } from '/@/shared/types/domain/album-domain-types';
AlbumListSort, import { ControllerEndpoint } from '/@/shared/types/domain/api-domain-types';
ControllerEndpoint, import { sortAlbumArtistList } from '/@/shared/types/domain/artist-domain-types';
GenreListSort, import { GenreListSort } from '/@/shared/types/domain/genre-domain-types';
LibraryItem, import { PlaylistListSort } from '/@/shared/types/domain/playlist-domain-types';
PlaylistListSort, import { ServerFeatures } from '/@/shared/types/domain/server-domain-types';
Song, import { LibraryItem, ListSortOrder } from '/@/shared/types/domain/shared-domain-types';
sortAlbumArtistList, import { Song, sortSongList } from '/@/shared/types/domain/song-domain-types';
sortAlbumList,
SortOrder,
sortSongList,
} from '/@/shared/types/domain-types';
import { ServerFeatures } from '/@/shared/types/features-types';
const ALBUM_LIST_SORT_MAPPING: Record<AlbumListSort, AlbumListSortType | undefined> = { const ALBUM_LIST_SORT_MAPPING: Record<AlbumListSort, AlbumListSortType | undefined> = {
[AlbumListSort.ALBUM_ARTIST]: AlbumListSortType.ALPHABETICAL_BY_ARTIST, [AlbumListSort.ALBUM_ARTIST]: AlbumListSortType.ALPHABETICAL_BY_ARTIST,
@@ -381,7 +376,7 @@ export const SubsonicController: ControllerEndpoint = {
} }
if (type === AlbumListSortType.BY_YEAR && !fromYear && !toYear) { if (type === AlbumListSortType.BY_YEAR && !fromYear && !toYear) {
if (query.sortOrder === SortOrder.ASC) { if (query.sortOrder === ListSortOrder.ASC) {
fromYear = 0; fromYear = 0;
toYear = dayjs().year(); toYear = dayjs().year();
} else { } else {
@@ -13,6 +13,7 @@ import {
ServerMusicFolder, ServerMusicFolder,
ServerType, ServerType,
} from '/@/shared/types/domain/server-domain-types'; } from '/@/shared/types/domain/server-domain-types';
import { LibraryItem } from '/@/shared/types/domain/shared-domain-types';
import { Song } from '/@/shared/types/domain/song-domain-types'; import { Song } from '/@/shared/types/domain/song-domain-types';
const getStreamUrl = (args: { const getStreamUrl = (args: {
@@ -10,6 +10,7 @@ import { AlbumArtist, RelatedArtist } from '/@/shared/types/domain/artist-domain
import { Genre } from '/@/shared/types/domain/genre-domain-types'; import { Genre } from '/@/shared/types/domain/genre-domain-types';
import { Playlist } from '/@/shared/types/domain/playlist-domain-types'; import { Playlist } from '/@/shared/types/domain/playlist-domain-types';
import { ServerListItem, ServerType } from '/@/shared/types/domain/server-domain-types'; import { ServerListItem, ServerType } from '/@/shared/types/domain/server-domain-types';
import { LibraryItem } from '/@/shared/types/domain/shared-domain-types';
import { Song } from '/@/shared/types/domain/song-domain-types'; import { Song } from '/@/shared/types/domain/song-domain-types';
import { User } from '/@/shared/types/domain/user-domain-types'; import { User } from '/@/shared/types/domain/user-domain-types';
@@ -2,12 +2,13 @@ import { nanoid } from 'nanoid';
import { z } from 'zod'; import { z } from 'zod';
import { ssType } from '/@/shared/api/subsonic/subsonic-types'; import { ssType } from '/@/shared/api/subsonic/subsonic-types';
import { LibraryItem, QueueSong } from '/@/shared/types/domain-types';
import { Album } from '/@/shared/types/domain/album-domain-types'; import { Album } from '/@/shared/types/domain/album-domain-types';
import { AlbumArtist, RelatedArtist } from '/@/shared/types/domain/artist-domain-types'; import { AlbumArtist, RelatedArtist } from '/@/shared/types/domain/artist-domain-types';
import { Genre } from '/@/shared/types/domain/genre-domain-types'; import { Genre } from '/@/shared/types/domain/genre-domain-types';
import { QueueSong } from '/@/shared/types/domain/player-domain-types';
import { Playlist } from '/@/shared/types/domain/playlist-domain-types'; import { Playlist } from '/@/shared/types/domain/playlist-domain-types';
import { ServerListItem, ServerType } from '/@/shared/types/domain/server-domain-types'; import { ServerListItem, ServerType } from '/@/shared/types/domain/server-domain-types';
import { LibraryItem } from '/@/shared/types/domain/shared-domain-types';
const getCoverArtUrl = (args: { const getCoverArtUrl = (args: {
baseUrl: string | undefined; baseUrl: string | undefined;
+1 -2
View File
@@ -4,8 +4,7 @@ import semverCoerce from 'semver/functions/coerce';
import semverGte from 'semver/functions/gte'; import semverGte from 'semver/functions/gte';
import { z } from 'zod'; import { z } from 'zod';
import { ServerListItem } from '/@/shared/types/domain/server-domain-types'; import { ServerFeature, ServerListItem } from '/@/shared/types/domain/server-domain-types';
import { ServerFeature } from '/@/shared/types/features-types';
// Since ts-rest client returns a strict response type, we need to add the headers to the body object // Since ts-rest client returns a strict response type, we need to add the headers to the body object
export const resultWithHeaders = <ItemType extends z.ZodTypeAny>(itemSchema: ItemType) => { export const resultWithHeaders = <ItemType extends z.ZodTypeAny>(itemSchema: ItemType) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge'; import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
import { LibraryItem } from '/@/shared/types/domain-types'; import { LibraryItem } from '/@/shared/types/domain/shared-domain-types';
export enum DragTarget { export enum DragTarget {
ALBUM = LibraryItem.ALBUM, ALBUM = LibraryItem.ALBUM,
-113
View File
@@ -1,113 +0,0 @@
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;
}
+2 -1
View File
@@ -2,11 +2,12 @@ import { AppRoute } from '@ts-rest/core';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { Song } from 'src/main/features/core/lyrics/netease'; import { Song } from 'src/main/features/core/lyrics/netease';
import { LibraryItem, QueueSong } from '/@/shared/types/domain-types';
import { Album } from '/@/shared/types/domain/album-domain-types'; import { Album } from '/@/shared/types/domain/album-domain-types';
import { AlbumArtist, Artist } from '/@/shared/types/domain/artist-domain-types'; import { AlbumArtist, Artist } from '/@/shared/types/domain/artist-domain-types';
import { QueueSong } from '/@/shared/types/domain/player-domain-types';
import { Playlist } from '/@/shared/types/domain/playlist-domain-types'; import { Playlist } from '/@/shared/types/domain/playlist-domain-types';
import { ServerType } from '/@/shared/types/domain/server-domain-types'; import { ServerType } from '/@/shared/types/domain/server-domain-types';
import { LibraryItem } from '/@/shared/types/domain/shared-domain-types';
export enum ListDisplayType { export enum ListDisplayType {
CARD = 'card', CARD = 'card',