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

Api error when playing liked songs #960

Open
Tonelllo opened this issue Mar 12, 2022 · 30 comments
Open

Api error when playing liked songs #960

Tonelllo opened this issue Mar 12, 2022 · 30 comments

Comments

@Tonelllo
Copy link

Screenshot (220)
Little after the start of spt I get this error

@Tonelllo
Copy link
Author

Forgot to mention that I downloaded the binaries for version 0.25.0

@apprehensions
Copy link

same error on Void Linux 5.16.11_1 spotify-tui version 0.25.0 build from repo

@apprehensions
Copy link

this issue will get fixed with ramsayleung/rspotify#306.

@apprehensions
Copy link

apprehensions commented Mar 13, 2022

@Rigellute i think you should update spotify-tui to the new version of rspotify when this change merges.

edit: dependabot already does this from what i see in the pull requests.

@Suyashtnt
Copy link

Suyashtnt commented Mar 21, 2022

@Rigellute i think you should update spotify-tui to the new version of rspotify when this change merges.

edit: dependabot already does this from what i see in the pull requests.

note: version 0.11.0 has a ton of breaking changes. It could require a mini rewrite of some of the modules

@p0ryae
Copy link

p0ryae commented Mar 21, 2022

Screenshot (220) Little after the start of spt I get this error

I can confirm this happening on Arch Linux
it seems to be a cross platform issue

@plsy1
Copy link

plsy1 commented Mar 25, 2022

same error on arch linux
spotify-tui 0.25.0
image

@charlesbarr
Copy link

charlesbarr commented Mar 27, 2022

Very much appears to be cross-platform. Same error on macOS Monterey 12.3 running spotify-tui 0.25.0 built via Homebrew.

My hacky workaround for the moment: don't play songs from my "liked" songs list. I can play songs in my "liked songs" list without error, but if I play the song from the liked songs list, I get the `unknown variant ``collection``` error. In other words, if I have "Hey Jude" in both my liked songs and a playlist called favesongs, I'd have no problem playing from favesongs or by searching for the song directly.

Screen Shot 2022-03-27 at 1 57 48 PM

@apprehensions
Copy link

@Rigellute please update Cargo.toml. rspotify 0.11.5 is released and solves this problem.

@Suyashtnt
Copy link

Suyashtnt commented Mar 29, 2022 via email

@B1T3X
Copy link

B1T3X commented Mar 31, 2022

I am experiencing this issue on MacOS Monterey, tried installing from source as-is, build succeeds but issue is still present. Tried editting the rspotify version to 0.11.5 on Cargo.toml and and build throws around 150 errors and won't succeed.

@Pat-
Copy link

Pat- commented Apr 2, 2022

same error on arch linux spotify-tui 0.25.0 image

getting this error also on arch.

@Suyashtnt
Copy link

someone rename this issue to Api error when playing liked songs as it seems to only happen on them

@apprehensions
Copy link

@Suyashtnt
Copy link

seems to only happen on them

#960 (comment) #960 (comment) #960 (comment) #960 (comment) #960 (comment) #960 (comment) #960 (comment)

try playing your liked songs, as its a spotify "collection"

@Tonelllo Tonelllo changed the title Api error on windows Api error when playing liked songs Apr 3, 2022
@Tonelllo
Copy link
Author

Tonelllo commented Apr 3, 2022

someone rename this issue to Api error when playing liked songs as it seems to only happen on them

Done! The fact that was giving me the error after the start was because the last song that I was playing before starting spt was in the liked songs.

@PetrifiedOak
Copy link

image
It worked for me? i got spotifyd from the aur maybe thats the solution

@apprehensions
Copy link

image
it works now...?

@The-Compiler
Copy link

Still didn't work for me - but I backported ramsayleung/rspotify#306 to rspotify 0.10:

From 408e6a5170bbe9f854bf46e1cbae21265cf25294 Mon Sep 17 00:00:00 2001
From: Florian Bruhin <[email protected]>
Date: Mon, 25 Apr 2022 18:39:07 +0200
Subject: [PATCH] Add Collection SearchType

Backport of https://github.com/ramsayleung/rspotify/pull/306
---
 src/senum.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/senum.rs b/src/senum.rs
index c94c31c..79d8730 100644
--- a/src/senum.rs
+++ b/src/senum.rs
@@ -87,6 +87,7 @@ pub enum Type {
     User,
     Show,
     Episode,
+    Collection,
 }
 impl Type {
     pub fn as_str(&self) -> &str {
@@ -98,6 +99,7 @@ pub fn as_str(&self) -> &str {
             Type::User => "user",
             Type::Show => "show",
             Type::Episode => "episode",
+            Type::Collection => "collection",
         }
     }
 }
@@ -112,6 +114,7 @@ fn from_str(s: &str) -> Result<Self, Self::Err> {
             "user" => Ok(Type::User),
             "show" => Ok(Type::Show),
             "episode" => Ok(Type::Episode),
+            "collection" => Ok(Type::Collection),
             _ => Err(Error::new(ErrorKind::NoEnum(s.to_owned()))),
         }
     }
-- 
2.35.3

which makes things work for me.

To use this with spotify-tui, patch Cargo.toml as follows:

--- Cargo.toml.bak	2022-04-25 18:20:04.329712912 +0200
+++ Cargo.toml	2022-04-25 18:20:44.296429608 +0200
@@ -29,6 +29,9 @@
 rand = "0.8.3"
 anyhow = "1.0.43"
 
+[patch.crates-io]
+rspotify = { path = "../rspotify-0.10.0" }
+
 [[bin]]
 bench = false
 path = "src/main.rs"

and download, rename (.crate -> .tar.gz) and patch rspotify-0.10.0.crate.

If you use the Archlinux spotify-tui PKGBUILD, here is a patch for the PKGBUILD which should work if you dump the two patches above in the same directory:

From 0f95ce58d7ee362dbfef6c5f92468e6454b48a3d Mon Sep 17 00:00:00 2001
From: Florian Bruhin <[email protected]>
Date: Mon, 25 Apr 2022 18:54:07 +0200
Subject: [PATCH] Add collection patches

---
 PKGBUILD | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index 42838ab..0e34d7a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,11 +10,27 @@ url=https://github.com/Rigellute/spotify-tui
 license=(MIT)
 depends=(openssl libxcb)
 makedepends=(cargo python)
-source=($pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz)
-sha512sums=('92a2ab53059b7d58e502a732f16a8eb725e19ea2e13c4f63dd64e3f0d62a3999f6b6b338c396db734f6ee9d63459da15e69b392f945c8f967d794447ac5ff8a4')
+source=(
+    $pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz
+    rspotify-0.10.0.tar.gz::https://crates.io/api/v1/crates/rspotify/0.10.0/download
+    Cargo.toml.patch
+    0001-Add-Collection-SearchType.patch
+)
+sha512sums=('92a2ab53059b7d58e502a732f16a8eb725e19ea2e13c4f63dd64e3f0d62a3999f6b6b338c396db734f6ee9d63459da15e69b392f945c8f967d794447ac5ff8a4'
+            '48db0018e65b516c34f8f31828178b361e701099850e043708f02754d4251e010f95aea6b49b5104263cb52ee815e9a25f6f371be202446975b3191c3f570daa'
+            '42e31bc3931f36c621000b17b5599ed42da0211e6543cb30c98a3140fdd02e1c607d04f09bde259c9039bfde5cc783f4cb92d3e60d302f37f7dfddeec8f46cbf'
+            '89a1efdc38e14c7a32268fb8ac8c2235d9ae6d888d516a55bbc34933e881fe35d107d8feffe7a572b203e8ac2a553c7c4f4862af4dd3b7ea1391d4fb9ff1dca0')
 provides=('spotify-tui')
 conflicts=('spotify-tui')
 
+prepare() {
+  cd $pkgname-$pkgver
+  patch -p0 -i"$srcdir/Cargo.toml.patch"
+
+  cd "$srcdir/rspotify-0.10.0"
+  patch -p1 -i"$srcdir/0001-Add-Collection-SearchType.patch"
+}
+
 build() {
   cd $pkgname-$pkgver
   cargo build --release --target-dir "target/"
-- 
2.35.3

After that, things seem to work fine for me.

@orhun
Copy link

orhun commented Apr 27, 2022

If you use the Archlinux spotify-tui PKGBUILD, here is a patch for the PKGBUILD which should work if you dump the two patches above in the same directory:

I applied the patch to the AUR package. Thanks!

@ehawman
Copy link

ehawman commented Aug 15, 2022

Just wanted to poke this issue. I am experiencing this on Win 11 as well.

@KyleTryon
Copy link

Coming in to confirm, I am on Windows 11 using WSL 2 in with Ubuntu 22.04 compiled with rust. I only experience this issue if playing liked songs.

@forgoty
Copy link

forgoty commented Nov 3, 2022

Confirming it at arch linux latest build of spotify-tui-bin through yay

@T7a9
Copy link

T7a9 commented Nov 5, 2022

Confirming it's still here, OSX 12.4 w/ homebrew. Playing liked songs from other devices and then transferring to spotify-tui seems to be the issue.

@ricardoantonio
Copy link

Looks like this repository is no longer in maintenance?

@apprehensions
Copy link

Looks like this repository is no longer in maintenance?

#1000

@lukeberry99
Copy link

Any solutions to this? Same issue on Monterey.

@The-Compiler
Copy link

@lukeberry99 my comment above (#960 (comment)) has a patch which fixes the issue.

@Tvde1
Copy link

Tvde1 commented Aug 17, 2023

Installed it on windows, and started spotify, and this happens. Any plans on fixing this?

@apprehensions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests