Giter Site home page Giter Site logo

nrk-spotify's People

Contributors

mpolden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hasorli

nrk-spotify's Issues

Duplicate tracks

In some cases duplicate tracks might be added to the playlist.

This happens because failed requests are retried and Spotify sometimes returns 504 even if a request succeeds.

Example:

2014/08/04 08:49:12 Running sync
2014/08/04 08:49:12 NRK P3 Pyro is currently playing: Extreme - Decadence Dance (03:45/06:48) [======----]
2014/08/04 08:49:12 Searching for: Extreme - Decadence Dance
2014/08/04 08:49:12 Already added: Decadence Dance (4nJVAkLR6nd6cX5BmOuDmx)
2014/08/04 08:49:12 Searching for: Saxon - 747 (Strangers in the Night)
2014/08/04 08:49:15 Add track failed: request failed (504): 
2014/08/04 08:49:15 Retrying...
2014/08/04 08:49:16 Added track: 747 (Strangers in the Night) - 2009 - Remaster (1EORu8Coheibl21VjHtbRg)
2014/08/04 08:49:16 Cache size: 100/100
2014/08/04 08:49:16 Next sync in 5m0s

In the above example the track 747 (Strangers in the Night) is added twice.

Handling large playlists

Currently tracks will be added to the Spotify playlist until the playlist limit is reached.

This is because Spotify did not initially provide methods for removing tracks, but a method for setting tracks has now been added: https://developer.spotify.com/set-playlists-tracks/

Add a parameter which specifies if the playlist size should reflect the cache size. Then use the new method to stay within this limit. The cache can then be used to keep track of URIs which should be (re)set.

Adaptive interval and nonexistant tracks

If adaptive interval is enabled it should consider if the track was added when determining the next interval.

2014/08/05 09:04:42 Running sync
2014/08/05 09:04:42 NRK P3 Pyro is currently playing: Tool - Lateralis (04:48/09:22) [======----]
2014/08/05 09:04:42 Searching for: Tool - Lateralis
2014/08/05 09:04:43 Track not found: Tool - Lateralis
2014/08/05 09:04:43 Searching for: Cancer Bats - Breathe Armageddon
2014/08/05 09:04:43 Added track: Breathe Armageddon (3QEHSMT7krLnAzj4WrZcpB)
2014/08/05 09:04:43 Cache size: 100/100
2014/08/05 09:04:43 Next sync in 5m0s

If adaptive interval had been enabled in the above case, the duration of Tool - Lateralis should not have been included in the calculated interval.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.