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

Add collection variant to Type #306

Merged
merged 2 commits into from
Mar 13, 2022
Merged

Add collection variant to Type #306

merged 2 commits into from
Mar 13, 2022

Conversation

marioortizmanero
Copy link
Collaborator

Description

This simply adds a Collection variant to Type

Motivation and Context

See #218 (comment)

Dependencies

None

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

CI still passes

Is this change properly documented?

Yes

@ramsayleung ramsayleung merged commit b35a131 into master Mar 13, 2022
@ramsayleung ramsayleung deleted the collection branch March 13, 2022 14:07
@The-Compiler
Copy link

If anyone happens to need a backport of this to 0.10.0 (I needed it for spotify-tui), here is a patch:

From 408e6a5170bbe9f854bf46e1cbae21265cf25294 Mon Sep 17 00:00:00 2001
From: Florian Bruhin <me@the-compiler.org>
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

@Foxtrod89
Copy link

how to install it?

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

Successfully merging this pull request may close these issues.

None yet

4 participants