mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
refactor(music-network): move enrichment-primary icon/label hooks into music-network/ui
This commit is contained in:
@@ -7,9 +7,7 @@ import type { ArtistStats, TrackStats } from '@/music-network';
|
||||
import type { SubsonicOpenArtistRef } from '@/lib/api/subsonicTypes';
|
||||
import { OpenArtistRefInline } from '@/features/artist';
|
||||
import { formatTrackTime } from '@/lib/format/formatDuration';
|
||||
import { useEnrichmentPrimaryLabel } from '@/hooks/useEnrichmentPrimaryLabel';
|
||||
import { useEnrichmentPrimaryIcon } from '@/hooks/useEnrichmentPrimaryIcon';
|
||||
import { renderPresetIcon } from '@/music-network';
|
||||
import { renderPresetIcon, useEnrichmentPrimaryIcon, useEnrichmentPrimaryLabel } from '@/music-network';
|
||||
|
||||
interface HeroProps {
|
||||
track: { title: string; artist: string; album: string; year?: number;
|
||||
|
||||
@@ -15,9 +15,7 @@ import { OpenArtistRefInline } from '@/features/artist';
|
||||
import StarRating from '@/ui/StarRating';
|
||||
import { PlaybackBufferingOverlay } from '@/features/playback/components/PlaybackBufferingOverlay';
|
||||
import { usePlayerStore } from '@/features/playback/store/playerStore';
|
||||
import { useEnrichmentPrimaryLabel } from '@/hooks/useEnrichmentPrimaryLabel';
|
||||
import { useEnrichmentPrimaryIcon } from '@/hooks/useEnrichmentPrimaryIcon';
|
||||
import { renderPresetIcon } from '@/music-network';
|
||||
import { renderPresetIcon, useEnrichmentPrimaryIcon, useEnrichmentPrimaryLabel } from '@/music-network';
|
||||
import {
|
||||
usePlayerBarLayoutStore,
|
||||
type PlayerBarLayoutItemId,
|
||||
|
||||
@@ -12,10 +12,9 @@ import StatisticsTabBar from '@/features/stats/components/StatisticsTabBar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { getMusicNetworkRuntime, type RecentTrack, type StatsPeriod, type TopItem } from '@/music-network';
|
||||
import { getMusicNetworkRuntime, useEnrichmentPrimaryLabel, type RecentTrack, type StatsPeriod, type TopItem } from '@/music-network';
|
||||
import { useOfflineBrowseContext } from '@/features/offline';
|
||||
import { usePlayerStatsRecordingEnabled } from '@/features/stats/hooks/usePlayerStatsRecordingEnabled';
|
||||
import { useEnrichmentPrimaryLabel } from '@/hooks/useEnrichmentPrimaryLabel';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function relativeTime(timestamp: number, t: (key: string, opts?: any) => string): string {
|
||||
|
||||
@@ -12,6 +12,8 @@ export {
|
||||
export type { MusicNetworkStore, RuntimeHost } from './runtime/store';
|
||||
export { listPresets, getPreset } from './registry/presetRegistry';
|
||||
export { useEnrichmentPrimary, type EnrichmentPrimary } from './ui/useEnrichmentPrimary';
|
||||
export { useEnrichmentPrimaryIcon } from './ui/useEnrichmentPrimaryIcon';
|
||||
export { useEnrichmentPrimaryLabel } from './ui/useEnrichmentPrimaryLabel';
|
||||
export { renderPresetIcon } from './ui/presetIcon';
|
||||
export { default as MusicNetworkIndicator } from './ui/MusicNetworkIndicator';
|
||||
export {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEnrichmentPrimary, type PresetIcon } from '../music-network';
|
||||
import type { PresetIcon } from '@/music-network';
|
||||
import { useEnrichmentPrimary } from './useEnrichmentPrimary';
|
||||
|
||||
/**
|
||||
* Manifest icon id of the current enrichment-primary provider, or null when no
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEnrichmentPrimary } from '../music-network';
|
||||
import { useEnrichmentPrimary } from './useEnrichmentPrimary';
|
||||
|
||||
/**
|
||||
* Display label of the current enrichment-primary account (e.g. "Last.fm",
|
||||
|
||||
Reference in New Issue
Block a user