Playback fix
🏗️ Build and Test JellyTau / Run Tests (push) Successful in 4m28s
Traceability Validation / Check Requirement Traces (push) Successful in 22s
🏗️ Build and Test JellyTau / Build Android APK (push) Successful in 18m37s
Build & Release / Run Tests (push) Successful in 4m12s
Build & Release / Build Linux (push) Successful in 16m20s
Build & Release / Build Android (push) Successful in 18m57s
Build & Release / Create Release (push) Successful in 13s
🏗️ Build and Test JellyTau / Run Tests (push) Successful in 4m28s
Traceability Validation / Check Requirement Traces (push) Successful in 22s
🏗️ Build and Test JellyTau / Build Android APK (push) Successful in 18m37s
Build & Release / Run Tests (push) Successful in 4m12s
Build & Release / Build Linux (push) Successful in 16m20s
Build & Release / Build Android (push) Successful in 18m57s
Build & Release / Create Release (push) Successful in 13s
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { commands } from "$lib/api/bindings";
|
||||
import { playerController } from "$lib/player";
|
||||
import { truncateMiddle } from "$lib/utils/truncateMiddle";
|
||||
import type { PlayTracksContext } from "$lib/api/bindings";
|
||||
import { goto } from "$app/navigation";
|
||||
import { queue } from "$lib/stores/queue";
|
||||
import { auth } from "$lib/stores/auth";
|
||||
import { currentMedia } from "$lib/stores/player";
|
||||
import { toast } from "$lib/stores/toast";
|
||||
import type { MediaItem } from "$lib/api/types";
|
||||
@@ -54,17 +53,10 @@
|
||||
try {
|
||||
isPlayingTrack = track.id;
|
||||
|
||||
// Validate auth before proceeding
|
||||
const repo = auth.getRepository();
|
||||
if (!repo) {
|
||||
throw new Error("Not authenticated");
|
||||
}
|
||||
|
||||
// If this is an album, use the backend album command (more efficient)
|
||||
if (context && context.type === "album") {
|
||||
const repositoryHandle = repo.getHandle();
|
||||
console.log(`[TrackList] Playing track: "${track.name}" (ID: ${track.id}, index in list: ${index})`);
|
||||
await commands.playerPlayAlbumTrack(repositoryHandle, {
|
||||
await playerController.playAlbumTrack({
|
||||
albumId: context.albumId,
|
||||
albumName: context.albumName,
|
||||
trackId: track.id,
|
||||
@@ -75,7 +67,6 @@
|
||||
|
||||
// Use new backend command for non-album contexts (playlists, custom queues, etc.)
|
||||
// Backend handles all metadata fetching and queue building
|
||||
const repositoryHandle = repo.getHandle();
|
||||
const trackIds = tracks.map((t) => t.id);
|
||||
|
||||
// Determine context for queue
|
||||
@@ -90,7 +81,7 @@
|
||||
playContext = { type: "custom", label: null };
|
||||
}
|
||||
|
||||
await commands.playerPlayTracks(repositoryHandle, {
|
||||
await playerController.playTracks({
|
||||
trackIds,
|
||||
startIndex: index,
|
||||
shuffle: false,
|
||||
|
||||
Reference in New Issue
Block a user