From 06b0b26ccfe522e4e071b3674396027bb9feb7c0 Mon Sep 17 00:00:00 2001
From: Derek Yang <115889767+DerekYang2@users.noreply.github.com>
Date: Sat, 5 Oct 2024 12:08:30 -0400
Subject: [PATCH] Update youtube api versions, fix qobuz changes and other
minor bugs
---
FluentDL.csproj | 4 ++--
Services/QobuzApi.cs | 32 ++++++++++++++++----------------
Services/YoutubeApi.cs | 9 +++++++--
Views/QueuePage.xaml.cs | 2 +-
Views/Search.xaml.cs | 3 ++-
Views/SettingsPage.xaml.cs | 2 +-
6 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/FluentDL.csproj b/FluentDL.csproj
index da4036f..f43ed40 100644
--- a/FluentDL.csproj
+++ b/FluentDL.csproj
@@ -50,8 +50,8 @@
-
-
+
+
diff --git a/Services/QobuzApi.cs b/Services/QobuzApi.cs
index d541777..1438087 100644
--- a/Services/QobuzApi.cs
+++ b/Services/QobuzApi.cs
@@ -59,7 +59,7 @@ public static async Task GeneralSearch(ObservableCollection it
return;
}
- var results = await Task.Run(() => apiService.SearchTracks(query, limit), token);
+ var results = await Task.Run(() => apiService.SearchTracks(query, limit, withAuth: true), token);
if (results == null || results.Tracks == null)
{
@@ -100,7 +100,7 @@ public static async Task AdvancedSearch(ObservableCollection i
if (!string.IsNullOrWhiteSpace(albumName))
{
- var albumResults = await Task.Run(() => apiService.SearchAlbums(albumName, 5), token);
+ var albumResults = await Task.Run(() => apiService.SearchAlbums(albumName, 5, withAuth: true), token);
if (token.IsCancellationRequested) return; // Check if task is cancelled
@@ -129,7 +129,7 @@ public static async Task AdvancedSearch(ObservableCollection i
if (oneArtistMatch && CloseMatch(albumName, album.Title))
{
- var fullAlbumObj = await Task.Run(() => apiService.GetAlbum(album.Id), token);
+ var fullAlbumObj = await Task.Run(() => apiService.GetAlbum(album.Id, withAuth: true), token);
if (fullAlbumObj == null || fullAlbumObj.Tracks == null || fullAlbumObj.Tracks.Items.Count == 0) continue;
@@ -179,7 +179,7 @@ public static async Task AdvancedSearch(ObservableCollection i
do // Iterate through all tracks of the artist
{
- var result = await Task.Run(() => apiService.SearchTracks(artistName + " " + trackName, 10, offset), token);
+ var result = await Task.Run(() => apiService.SearchTracks(artistName + " " + trackName, 10, offset, withAuth: true), token);
if (token.IsCancellationRequested) return; // Check if task is cancelled
@@ -221,7 +221,7 @@ public static async Task AdvancedSearch(ObservableCollection i
do
{
- var result = await Task.Run(() => apiService.SearchTracks(artistName, 10, offset), token);
+ var result = await Task.Run(() => apiService.SearchTracks(artistName, 10, offset, withAuth: true), token);
if (token.IsCancellationRequested) return; // Check if task is cancelled
if (result.Tracks != null && result.Tracks.Items.Count > 0)
@@ -269,14 +269,14 @@ public static async Task AddTracksFromLink(ObservableCollectionQobuz Loaded track {track.Title}"); // Show a success message
}
else if (isAlbum)
{
- var album = await Task.Run(() => apiService.GetAlbum(id), token);
+ var album = await Task.Run(() => apiService.GetAlbum(id, withAuth: true), token);
if (album.Tracks != null && album.Tracks.Items.Count > 0)
{
@@ -298,7 +298,7 @@ public static async Task AddTracksFromLink(ObservableCollection apiService.GetPlaylist(id, withAuth: IsInitialized), token);
+ var playlist = await Task.Run(() => apiService.GetPlaylist(id, withAuth: true), token);
if (playlist.Tracks != null && playlist.Tracks.Items.Count > 0)
{
@@ -312,7 +312,7 @@ public static async Task AddTracksFromLink(ObservableCollection ConvertSongSearchObject(apiService.GetTrack(track.Id.ToString())), token));
+ itemSource.Add(await Task.Run(() => ConvertSongSearchObject(apiService.GetTrack(track.Id.ToString(), withAuth: true)), token));
}
statusUpdate?.Invoke(InfoBarSeverity.Success, $"Qobuz Loaded playlist {playlist.Name}"); // Show a success message
@@ -380,7 +380,7 @@ public static SongSearchObject CreateSongSearchObject(Track track, Album album)
public static async Task