fix all imports for new structure

This commit is contained in:
jeffvli 2025-05-20 19:23:36 -07:00
parent 249eaf89f8
commit 930165d006
291 changed files with 2056 additions and 1894 deletions

View file

@ -1,11 +1,14 @@
import type { AuthenticationResponse, ControllerEndpoint, ServerType } from '/@/renderer/api/types';
import i18n from '/@/i18n/i18n';
import { JellyfinController } from '/@/renderer/api/jellyfin/jellyfin-controller';
import { NavidromeController } from '/@/renderer/api/navidrome/navidrome-controller';
import { SubsonicController } from '/@/renderer/api/subsonic/subsonic-controller';
import { toast } from '/@/renderer/components/toast/index';
import { useAuthStore } from '/@/renderer/store';
import {
AuthenticationResponse,
ControllerEndpoint,
ServerType,
} from '/@/shared/types/domain-types';
type ApiController = {
jellyfin: ControllerEndpoint;

View file

@ -7,10 +7,11 @@ import { z } from 'zod';
import packageJson from '../../../../package.json';
import i18n from '/@/i18n/i18n';
import { jfType } from '/@/renderer/api/jellyfin/jellyfin-types';
import { ServerListItem } from '/@/renderer/api/types';
import { authenticationFailure, getClientType } from '/@/renderer/api/utils';
import { authenticationFailure } from '/@/renderer/api/utils';
import { useAuthStore } from '/@/renderer/store';
import { jfType } from '/@/shared/api/jellyfin/jellyfin-types';
import { getClientType } from '/@/shared/api/utils';
import { ServerListItem } from '/@/shared/types/domain-types';
const c = initContract();

View file

@ -1,12 +1,11 @@
import chunk from 'lodash/chunk';
import { z } from 'zod';
import { jfNormalize } from './jellyfin-normalize';
import { ServerFeature } from '/@/renderer/api/features-types';
import { JFSongListSort, JFSortOrder } from '/@/renderer/api/jellyfin.types';
import { jfApiClient } from '/@/renderer/api/jellyfin/jellyfin-api';
import { jfType } from '/@/renderer/api/jellyfin/jellyfin-types';
import { JFSongListSort, JFSortOrder } from '/@/shared/api/jellyfin.types';
import { jfNormalize } from '/@/shared/api/jellyfin/jellyfin-normalize';
import { jfType } from '/@/shared/api/jellyfin/jellyfin-types';
import { getFeatures, hasFeature, VersionInfo } from '/@/shared/api/utils';
import {
albumArtistListSortMap,
albumListSortMap,
@ -18,8 +17,8 @@ import {
Song,
songListSortMap,
sortOrderMap,
} from '/@/renderer/api/types';
import { getFeatures, hasFeature, VersionInfo } from '/@/renderer/api/utils';
} from '/@/shared/types/domain-types';
import { ServerFeature } from '/@/shared/types/features-types';
const formatCommaDelimitedString = (value: string[]) => {
return value.join(',');
@ -282,7 +281,7 @@ export const JellyfinController: ControllerEndpoint = {
throw new Error('No userId found');
}
const yearsGroup = [];
const yearsGroup: string[] = [];
if (query.minYear && query.maxYear) {
for (let i = Number(query.minYear); i <= Number(query.maxYear); i += 1) {
yearsGroup.push(String(i));
@ -555,7 +554,7 @@ export const JellyfinController: ControllerEndpoint = {
throw new Error('No userId found');
}
const yearsGroup = [];
const yearsGroup: string[] = [];
if (query.minYear && query.maxYear) {
for (let i = Number(query.minYear); i <= Number(query.maxYear); i += 1) {
yearsGroup.push(String(i));
@ -692,7 +691,7 @@ export const JellyfinController: ControllerEndpoint = {
throw new Error('No userId found');
}
const yearsGroup = [];
const yearsGroup: string[] = [];
if (query.minYear && query.maxYear) {
for (let i = Number(query.minYear); i <= Number(query.maxYear); i += 1) {
yearsGroup.push(String(i));

View file

@ -5,13 +5,13 @@ import debounce from 'lodash/debounce';
import omitBy from 'lodash/omitBy';
import qs from 'qs';
import { ndType } from './navidrome-types';
import i18n from '/@/i18n/i18n';
import { ServerListItem } from '/@/renderer/api/types';
import { authenticationFailure, resultWithHeaders } from '/@/renderer/api/utils';
import { toast } from '/@/renderer/components/toast';
import { authenticationFailure } from '/@/renderer/api/utils';
import { toast } from '/@/renderer/components';
import { useAuthStore } from '/@/renderer/store';
import { ndType } from '/@/shared/api/navidrome/navidrome-types';
import { resultWithHeaders } from '/@/shared/api/utils';
import { ServerListItem } from '/@/shared/types/domain-types';
const localSettings = isElectron() ? window.api.localSettings : null;
@ -274,7 +274,6 @@ axiosClient.interceptors.response.use(
const currentServer = useAuthStore.getState().currentServer;
if (localSettings && currentServer?.savePassword) {
// eslint-disable-next-line promise/no-promise-in-callback
return localSettings
.passwordGet(currentServer.id)
.then(async (password: null | string) => {

View file

@ -1,3 +1,12 @@
import { ndApiClient } from '/@/renderer/api/navidrome/navidrome-api';
import { ssApiClient } from '/@/renderer/api/subsonic/subsonic-api';
import { SubsonicController } from '/@/renderer/api/subsonic/subsonic-controller';
import { NDSongListSort } from '/@/shared/api/navidrome.types';
import { ndNormalize } from '/@/shared/api/navidrome/navidrome-normalize';
import { ndType } from '/@/shared/api/navidrome/navidrome-types';
import { ssNormalize } from '/@/shared/api/subsonic/subsonic-normalize';
import { SubsonicExtensions } from '/@/shared/api/subsonic/subsonic-types';
import { getFeatures, hasFeature, VersionInfo } from '/@/shared/api/utils';
import {
albumArtistListSortMap,
albumListSortMap,
@ -12,18 +21,8 @@ import {
songListSortMap,
sortOrderMap,
userListSortMap,
} from '../types';
import { ServerFeature, ServerFeatures } from '/@/renderer/api/features-types';
import { NDSongListSort } from '/@/renderer/api/navidrome.types';
import { ndApiClient } from '/@/renderer/api/navidrome/navidrome-api';
import { ndNormalize } from '/@/renderer/api/navidrome/navidrome-normalize';
import { ndType } from '/@/renderer/api/navidrome/navidrome-types';
import { ssApiClient } from '/@/renderer/api/subsonic/subsonic-api';
import { SubsonicController } from '/@/renderer/api/subsonic/subsonic-controller';
import { ssNormalize } from '/@/renderer/api/subsonic/subsonic-normalize';
import { SubsonicExtensions } from '/@/renderer/api/subsonic/subsonic-types';
import { getFeatures, hasFeature, VersionInfo } from '/@/renderer/api/utils';
} from '/@/shared/types/domain-types';
import { ServerFeature, ServerFeatures } from '/@/shared/types/features-types';
const VERSION_INFO: VersionInfo = [
['0.55.0', { [ServerFeature.BFR]: [1] }],

View file

@ -1,5 +1,3 @@
import { QueryFunctionContext } from '@tanstack/react-query';
import type {
AlbumArtistDetailQuery,
AlbumArtistListQuery,
@ -19,9 +17,11 @@ import type {
SongListQuery,
TopSongListQuery,
UserListQuery,
} from './types';
} from '/@/shared/types/domain-types';
import { LyricSource } from './types';
import { QueryFunctionContext } from '@tanstack/react-query';
import { LyricSource } from '/@/shared/types/domain-types';
export const splitPaginatedQuery = (key: any) => {
const { limit, startIndex, ...filter } = key || {};

View file

@ -5,9 +5,9 @@ import qs from 'qs';
import { z } from 'zod';
import i18n from '/@/i18n/i18n';
import { ssType } from '/@/renderer/api/subsonic/subsonic-types';
import { ServerListItem } from '/@/renderer/api/types';
import { toast } from '/@/renderer/components/toast/index';
import { ssType } from '/@/shared/api/subsonic/subsonic-types';
import { ServerListItem } from '/@/shared/types/domain-types';
const c = initContract();

View file

@ -3,10 +3,10 @@ import filter from 'lodash/filter';
import orderBy from 'lodash/orderBy';
import md5 from 'md5';
import { ServerFeatures } from '/@/renderer/api/features-types';
import { ssApiClient } from '/@/renderer/api/subsonic/subsonic-api';
import { ssNormalize } from '/@/renderer/api/subsonic/subsonic-normalize';
import { AlbumListSortType, SubsonicExtensions } from '/@/renderer/api/subsonic/subsonic-types';
import { randomString } from '/@/renderer/utils';
import { ssNormalize } from '/@/shared/api/subsonic/subsonic-normalize';
import { AlbumListSortType, SubsonicExtensions } from '/@/shared/api/subsonic/subsonic-types';
import {
AlbumListSort,
ControllerEndpoint,
@ -18,8 +18,8 @@ import {
sortAlbumList,
SortOrder,
sortSongList,
} from '/@/renderer/api/types';
import { randomString } from '/@/renderer/utils';
} from '/@/shared/types/domain-types';
import { ServerFeatures } from '/@/shared/types/features-types';
const ALBUM_LIST_SORT_MAPPING: Record<AlbumListSort, AlbumListSortType | undefined> = {
[AlbumListSort.ALBUM_ARTIST]: AlbumListSortType.ALPHABETICAL_BY_ARTIST,
@ -287,7 +287,7 @@ export const SubsonicController: ControllerEndpoint = {
let type = ALBUM_LIST_SORT_MAPPING[query.sortBy] ?? AlbumListSortType.ALPHABETICAL_BY_NAME;
if (query.artistIds) {
const promises = [];
const promises: any[] = [];
for (const artistId of query.artistIds) {
promises.push(
@ -858,8 +858,8 @@ export const SubsonicController: ControllerEndpoint = {
return ssNormalize.song(res.body.song, apiClientProps.server);
},
getSongList: async ({ apiClientProps, query }) => {
const fromAlbumPromises = [];
const artistDetailPromises = [];
const fromAlbumPromises: any[] = [];
const artistDetailPromises: any[] = [];
let results: any[] = [];
if (query.searchTerm) {