mirror of
https://github.com/Boof2015/astra-mobile.git
synced 2026-08-21 13:09:46 +02:00
port over astra desktop tag algos
This commit is contained in:
@@ -10,22 +10,25 @@ import { TrackActionsSheet } from '@/components/library/TrackActionsSheet';
|
||||
import { colors, radius, spacing } from '@/theme';
|
||||
import { useLibraryStore } from '@/stores/libraryStore';
|
||||
import { usePlayerStore } from '@/stores/playerStore';
|
||||
import { useSettingsStore } from '@/stores/settingsStore';
|
||||
import { playTracks, shuffleTracks } from '@/audio/playbackController';
|
||||
import { dbTrackToTrack } from '@/library/trackAdapter';
|
||||
import { filterTracksByArtist } from '@/library/artistGrouping';
|
||||
import type { DbTrack } from '@/types/library';
|
||||
|
||||
export default function ArtistScreen() {
|
||||
const router = useRouter();
|
||||
const { name } = useLocalSearchParams<{ name: string }>();
|
||||
const allTracks = useLibraryStore((s) => s.tracks);
|
||||
const groupingMode = useSettingsStore((s) => s.artistGroupingMode);
|
||||
const currentPath = usePlayerStore((s) => s.currentTrack?.path);
|
||||
const [actionTrack, setActionTrack] = useState<DbTrack | null>(null);
|
||||
|
||||
// Store tracks are ordered artist/album/disc/track, so the filtered slice
|
||||
// keeps album grouping and track order.
|
||||
// Match the artist list's grouping mode; store tracks are ordered
|
||||
// artist/album/disc/track, so the filtered slice keeps album/track order.
|
||||
const tracks = useMemo(
|
||||
() => allTracks.filter((track) => track.artist === name),
|
||||
[allTracks, name]
|
||||
() => filterTracksByArtist(allTracks, name, groupingMode),
|
||||
[allTracks, name, groupingMode]
|
||||
);
|
||||
|
||||
const playFrom = (index: number) => {
|
||||
|
||||
Reference in New Issue
Block a user