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

Playlists #29

Open
sabjorn opened this issue May 7, 2020 · 10 comments
Open

Playlists #29

sabjorn opened this issue May 7, 2020 · 10 comments

Comments

@sabjorn
Copy link
Owner

sabjorn commented May 7, 2020

Problem
BC currently only has one mechanism for storing music for future purchasing--the wishlist. The wishlist cannot be organized into categories. The wishlist page does have a player but you must click on every item in the wishlist to get it to play.

Solution
A playlist (and queue) system for organizing future purchases and providing an easy mechanism to listen sequentially through the playlist.

ACs
* queue is visible on the left side, resembles the visual appearance of the right hand side bandcamp elements (shopping cart, etc)
* a "+" symbol (button) appears:
* on the right side of the "preview" button allows adding to queue
* next to the track or album release page player
* clicking on "+" will:
* add album to queue
* turn on preview indicator flag
* Albums in queue are buttons which when clicked opens player (IFrame)

Future Considerations:

  • BuyMusicClub export
@sabjorn
Copy link
Owner Author

sabjorn commented Jun 27, 2020

@emcniece this I think has some relation to #30

With many streaming services, the next queue is basically just another type of playlist. Likely we would want to be able to convert this into a crate.

@sabjorn
Copy link
Owner Author

sabjorn commented Feb 13, 2021

#72 shows that we can get information from an album/track page and so fetch can be used to get the page and then get all the data we need to add the track to a playlist:

let section = fetch("https://halfpastvibe.bandcamp.com/track/strong-disagreement-about-the-quality-of-the-beat")
  .then(response => response.text())
  .then(text => {
    const parser = new DOMParser();
    const htmlDocument = parser.parseFromString(text, "text/html");
    const section = JSON.parse(htmlDocument.documentElement.querySelector('script[type="application/ld+json"]').innerText);
    return section;
  })

@emcniece
Copy link
Collaborator

Looks like that should work. Consider adding a .catch((error) => {}) to the end of that promise chain, just in case DOM or JSON parsing fails.

@sabjorn
Copy link
Owner Author

sabjorn commented Feb 14, 2021

HTML5 sortable list!!!

libraries::
https://lukasoppermann.github.io/html5sortable/index.html

or

http://sortablejs.github.io/Sortable/

sortable is quite cool and has a nested thing that could be really cool. For example: anything could be dropped into the "playlists" space, including another nested playlist, a track, or an album (which would actually make a playlist made up of the tracks from the album).

There is support for callbacks on interactions which could be tied to a db backend.

additionally, using sortable could be a really cool way to create a modular UI...


or, without a library:

https://stackoverflow.com/questions/10588607/tutorial-for-html5-dragdrop-sortable-list
https://codepen.io/crouchingtigerhiddenadam/pen/qKXgap

@sabjorn
Copy link
Owner Author

sabjorn commented Feb 14, 2021

example of nested sortable: https://jsbin.com/bikecuheza/edit?html,js,console,output

@sabjorn sabjorn changed the title Listen to Next Queue Playlists Feb 14, 2021
@sabjorn sabjorn added this to the Player and Playlists milestone Dec 30, 2021
@sabjorn
Copy link
Owner Author

sabjorn commented Mar 20, 2022

note: the concept of a playlist already exists in the html5 world: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/audioTracks

and styling the audio player can likely mostly be done with: https://developer.mozilla.org/en-US/docs/Web/Guide/Audio_and_video_delivery/Video_player_styling_basics

@sabjorn
Copy link
Owner Author

sabjorn commented Mar 21, 2022

API call for getting user purchases:

curl 'https://bandcamp.com/api/fancollection/1/collection_items' \
  --data-raw '{"fan_id":896389,"older_than_token":"1646449273:952244090:t::","count":1000}' \
  --compressed

@sabjorn
Copy link
Owner Author

sabjorn commented Mar 23, 2022

  • random shuffling of playlist/queue
  • toggle "hide already listened to" -- allowing for returning to queue and listening to only stuff you haven't listened to before

@sabjorn
Copy link
Owner Author

sabjorn commented Jan 30, 2023

todo:

  • UI design
  • track tracks listened to by user
  • popup type in cost for $0 items
  • infinite scroll for feed -- example implementation here, and here
  • toggle feature individually on each page (w/ global config)
  • toggle seeing tracks that have been listened to (w/ global config)
  • toggle continuous play mode

@sabjorn
Copy link
Owner Author

sabjorn commented Feb 5, 2023

note:
according to comment here

the ports close after Ports are closed after 5 minutes in MV3. Don't use ports. Use one-time messages.

so everything should likely be done as chrome.runtime.sendMessage

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

No branches or pull requests

2 participants