Comments (6)
Also related: spotipy-dev/spotipy#1063
from tekore.
I found this issue trying to track down whether tekore has ever supported removing playlist items by index. Apparently it has, according to add1f2a and #315. As far as I can see, even though the functionality is not documented here, it still works: you can delete tracks with indexes providing a body like this:
{
"tracks": [
{
"uri": "spotify:track:6YowAxI2HIbhAwumOqpldE",
"positions": [7]
}
]
}
I verified this at https://spotify-dedup.com/ (it sends Spotify API requests right from the browser, so it's easy to verify).
I am currently working on an app that, among other things, allow removing duplicate tracks from playlists, and without being able to remove playlist items by their index the workflow is much more involved than I'd like it to be: I have to remove the track by ID, which removes all its occurrences, then re-add the same track to the position of its first occurrence. And that's not to mention a full backup of the entire playlist in question, in case something goes wrong along the way.
Is there a story behind why #315 came to be? My guess is that it probably was spotipy-dev/spotipy#1063. Is there a reason tekore would not want to bring back the playlist_remove_occurrences
method, removed in add1f2a, even though the official API docs don't mention the functionality?
from tekore.
We actually got errors in our tests from Spotify. The logs will expire soon, but here it is (400: Could not remove tracks, please check parameters.). The previous body only included the positions parameter, but that's interesting if it works! Thank you 👌 Would you be willing to contribute a fix?
from tekore.
Hm, interesting. The failed test was calling playlist_remove_indices
. playlist_remove_occurrences
call however, which in the test is made before playlist_remove_indices
, succeeded.
I'll create a PR to add the playlist_remove_occurrences
back. I'll also verify if playlist_remove_indices
works, and add it back too if it does.
Since this functionality is undocumented, I think it would be convenient for the user to know about this. I was thinking about something along the lines of a RuntimeWarning
if the user calls a function that utilizes undocumented features. What do you think?
from tekore.
Oh, fair! I may have jumped the gun with that when I saw it wasn't documented anymore. And that sounds good. RuntimeWarnings are a bit much. I've resorted to just documenting the fact that it's not mentioned officially. So a note in the docstring would be enough for me! Thank you!
from tekore.
remove_indices
still not working, but the old remove_occurrences
does! I couldn't find any other things we've missed though.
from tekore.
Related Issues (20)
- Test Python 3.12
- Album label can be none
- Support for the new Spotify Links HOT 9
- Add missing is_externally_hosted to audiobooks
- saved_tracks() and search() functions not working with a market argument HOT 2
- Pydantic v2.5.0 breaks unions HOT 4
- Pydantic Validation Error with Docker. HOT 2
- Available market is missing in chapter
- ValidationError when requesting a playlist containing an episode HOT 8
- Support HTTPX 0.26
- Use Spotify's OpenAPI spec to generate or update models
- Improve unknown model attribute warning
- Missing tag for 5.3.0 HOT 2
- Playlist remove indices has been removed
- Fix RTD build
- Support HTTPX 0.27
- ValueError: 'EP' is not a valid AlbumType raised when calling current_user_top_tracks() HOT 3
- CurrentlyPlayingContext has unknown smart_shuffle
- `available_markets` missing for multiple models
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tekore.