Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: menu #106

Merged
merged 22 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/data/LibraryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,21 +339,6 @@ export async function openTauriImportDialog() {
}
}

export async function rescanAlbumArtwork(album: Album) {
// console.log("adding artwork from song", song, newAlbum);

const response = await invoke<ToImport>("scan_paths", {
event: {
paths: [album.path],
recursive: false,
process_albums: true,
is_async: false,
},
});

// TODO: Write updated album with updated artwork to DB
}

export async function runScan() {
const settings = get(userSettings);

Expand Down
1 change: 0 additions & 1 deletion src/data/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export const nextUpSong: Writable<Song> = writable(null);
export const songsJustAdded: Writable<Song[]> = writable([]);
export const songJustAdded = writable(false);
export const shouldShowToast = writable(true);
export const rightClickedAlbum: Writable<Album> = writable(null);
export const rightClickedTrack: Writable<Song> = writable(null);
export const rightClickedTracks: Writable<Song[]> = writable(null);
export const playerTime = writable(0);
Expand Down
8 changes: 8 additions & 0 deletions src/data/storeHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from "./store";
import AudioPlayer from "../lib/player/AudioPlayer";
import { get } from "svelte/store";
import { remove } from "lodash-es";
import type SmartQuery from "src/lib/smart-query/Query";

export function findQueueIndex({ id }: Song): number {
Expand All @@ -25,6 +26,13 @@ export function findQueueIndexes(songs: Song[]): number[] {
return songs.map(({ id }) => q.findIndex((song) => song.id === id));
}

export function removeQueuedSongs(songs: string[]) {
const olds = get(queue);
const news = remove(olds, ({ id }) => !songs.includes(id));

setQueue(news, false);
}

export function resetDraggedSongs() {
if (get(draggedSongs).length) {
draggedOrigin.set(null);
Expand Down
Loading
Loading