I'm wardbox.
wardbox / spotishell Goto Github PK
View Code? Open in Web Editor NEWA powershell module used to interact with the Spotify API
License: MIT License
A powershell module used to interact with the Spotify API
License: MIT License
First of all, amazing work on this module! I found one small easy to fix bug.
In the function for Set-ShufflePlayback you are attempting to convert a Boolean to lower. Need to convert System.Boolean to string then convert to lower.
Example Fix:
$Uri = 'https://api.spotify.com/v1/me/player/shuffle?state=' + $State.ToString().ToLower()
Describe the bug
When using Set-PlaylistItems with more than 100 tracks to add, the playlist only contains the last batch.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All tracks should be in the playlist
Desktop (please complete the following information):
Lot of functions uses $IsWindows, $IsMacOS and $IsLinux.
Those are shipped with PowerShell Core 6 and PowerShell 7
The psd1 file indicates:
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.0'
and then on a Powershell 5.1, the code bellow do anything, because all $Is... are $null and no browser opens up :
if ($IsMacOS) {
# opens the constructed uri in default browser on mac
Write-Verbose "We are on Mac OS"
open $URI
} elseif ($IsWindows) {
Write-Verbose "We are on Windows"
rundll32 url.dll,FileProtocolHandler $URI
}
PS C:\Users\maximla\Documents> Search-Spotify -Query "Bloc Party" -Artist
Invoke-WebRequest : {
"error": {
"status": 401,
"message": "The access token expired"
}
}
At C:\Users\maximla\Documents\PowerShell\Modules\Spotishell\0.1.9\Private\Send-SpotifyCall.ps1:67 char:19
+ ... $Response = Invoke-WebRequest -Method $Method -Headers $Header -Uri $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Method: GET, Reques…PowerShell/7.0.0
}:HttpRequestMessage) [Invoke-WebRequest], HttpResponseException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Is it possible to get the info from fields "written by" and "produced by" in a tracks "Song credits"?
Is your feature request related to a problem? Please describe.
When fetching tracks with Get-RecentlyPlayedTracks
as it is at the moment, no information regarding playback timestamp is available in spotishell, but the API does mention it being available (played_at
).
A (re-)write to allow getting this information would solve the problem. The simplest change is to change $Response.items.track
to $Response.items
at the end of the function. But this would be a breaking change.
Describe the solution you'd like
I would like to be able to get the played_at
value for each track. That way I might be able to page through my recently played tracks, using a combination of Limit
and BeforeTimestamp
/AfterTimestamp
.
Describe alternatives you've considered
I considered adding an additional argument to Get-RecentlyPlayedTracks
- something similar to a flag, eg. -ItemsNotTracks
and then inside the function simply check on this, and either use the current logic when the flag is missing and then use the new logic when it is available.
$tracks = Get-RecentlyPlayedTracks #Would work as is
$items = Get-RecentlyPlayedTracks -ItemsNotTracks #would return items, which has (atleast) 2 properties: `played_at`, `track`
this should take in the album Id i think
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.