Skip to content
Merged
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: 9 additions & 6 deletions mobile/src/modules/backup/M3U.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ export async function readM3UPlaylist() {
}

// Get uris so we can search our database.
const trackUris =
strategy === "absolute"
? trackPaths.map((path) => `file://${slashStart ? "" : "/"}${path}`)
: strategy === "relative"
? trackPaths.map((path) => joinPaths(fileDirectory, path))
: trackPaths;
const trackUris = Array.from(
new Set(
strategy === "absolute"
? trackPaths.map((path) => `file://${slashStart ? "" : "/"}${path}`)
: strategy === "relative"
? trackPaths.map((path) => joinPaths(fileDirectory, path))
: trackPaths,
),
);

const playlistTracks = await getTracks([
inArray(structuredTracksView.uri, trackUris),
Expand Down