webamp icon indicating copy to clipboard operation
webamp copied to clipboard

Please load playlist from external JSON file

Open sciner opened this issue 5 years ago • 8 comments

For make this:

  1. add few lines to ./js/config.ts:
import myPlaylist from "./../mp3/playlist.json";
console.log('myPlaylist', myPlaylist);
config.initialTracks = myPlaylist;
  1. Create file ./mp3/playlit.json

sciner avatar Oct 10 '18 00:10 sciner

Hey @sciner, could you explain a bit more what you are trying to do?

From what I can tell, your existing step one should work already. Are you looking for a way to export the current Webamp playlist?

captbaritone avatar Oct 10 '18 00:10 captbaritone

I propose to remove the playlist from the code to an external file.

sciner avatar Oct 10 '18 00:10 sciner

Are you suggesting that we do this on the demo site, or are you looking for a way to do this with your own project?

captbaritone avatar Oct 10 '18 00:10 captbaritone

Yes, I propose to do it on the demo site. Is it bad?

sciner avatar Oct 10 '18 01:10 sciner

What would we gain by storing the playlist in a json file?

captbaritone avatar Oct 10 '18 01:10 captbaritone

  1. Separation of logic from data
  2. The ability to download a playlist from any other site without having to edit the configuration file
  3. The playlist is in the configuration file, although it is not a configuration item.

sciner avatar Oct 10 '18 01:10 sciner

You're correct that it would probably be a little bit cleaner to at least move the playlist to its own file (.js might be just as good as json).

Currently it's very tricky to setup a server to serve media files with the correct CORs headers so that Webamp can correctly read them. Because of this, I have not publicly exposed features that allow users to provide URLs to external media files. I suspect it would create a large support burden for us, and that very few people would actually have the combination of control of their server and technical know-how to set it up correctly.

Would you like to open a pull request to move the playlist out into its own file? I don't think I currently have bandwidth to take on a cleanup task like this, but if your interested in doing it, I'd gladly merge the pull request.

captbaritone avatar Oct 10 '18 01:10 captbaritone

hi, i'm looking for something similar for a little project of mine, basically have a very slimmed downed version of webamp in a bash for loop that inserts the name of the json file as the playlist inside each html page

is this possible or something that might be in the future plans for this project?

sorry for commenting on this few years old issue but i figured it's better than opening a duplicate

edit: i ended up manually adding the links to the pages, kind of hard to keep updated but at least i've came up with a way to do it efficiently, still would appreciate such an option but it's not a priority for me anymore

junguler avatar Jun 05 '23 03:06 junguler