INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MCWS API requests  (Read 1156 times)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
MCWS API requests
« on: November 24, 2021, 11:36:16 am »

Hi team,
While using MCWS API to process files in bulk I ran into some limitations. Could you please consider adding these functions:

Playlist\Clear
Purpose: remove all files from a playlist without deleting the playlist.
Reason: I need to recreate playlists from scratch, without changing their ID so that existing Views/Expressions/Playlists that rely on the ID keep working. Deleting and recreating a playlist is fast, but the ID changes.

Playlist\AddFiles
Purpose: add a list of files (by key list) to an existing playlist
Reason: this avoids having to do 1000 API calls to add 1000 files. Playlist\Build can do that, but only when creating a new list. Also, when creating a new list with a few thousand files it's not possible to add them all in a single go as the URL would exceed the maximum length. So this new Playlist\AddFiles would allow creating large lists in batches.

Playlist\RemoveFiles
Purpose: the complement to AddFiles above.

Thank you, and happy thanksgiving!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42441
  • Shoes gone again!
Re: MCWS API requests
« Reply #1 on: November 25, 2021, 07:58:41 am »

I agree with your ideas.  I'll try to hook it up sometime in the future.  Thanks.
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42441
  • Shoes gone again!
Re: MCWS API requests
« Reply #2 on: December 07, 2021, 11:11:01 am »

Coming next build:
NEW: Added the MCWS function Playlist/AddFiles.
NEW: Added the MCWS function Playlist/Clear.
NEW: Added the MCWS function Playlist/RemoveFiles.

Thanks for the suggesion.
Logged
Matt Ashland, JRiver Media Center

zxsix

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1753
Re: MCWS API requests
« Reply #3 on: December 07, 2021, 11:18:28 am »

Thanks.  Looking forward to this.
Sytax help with adding only the currently playing track to a specific playlist ID would be appreciated.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10968
Re: MCWS API requests
« Reply #4 on: December 07, 2021, 11:20:19 am »

Get the key of the currently playing file from any of the Info commands, and use the new Playlist/AddFiles command to add it to one. Seems pretty straight forward.
Logged
~ nevcairiel
~ Author of LAV Filters

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: MCWS API requests
« Reply #5 on: December 07, 2021, 11:20:36 am »

Thanks again Matt!
Just remembered a useful parameter to AddFiles, perhaps you thought of it too: &allowdups=0 to remove duplicates; default is 1 to allow duplicates (or vice versa, up to you).

Alternative solutions:
/playlist/clear&dupsonly=1
/playlist/cleardups
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42441
  • Shoes gone again!
Re: MCWS API requests
« Reply #6 on: December 07, 2021, 12:17:04 pm »

We'll do this to avoid function pollution:
NEW: Added the MCWS function Playlist/RemoveDuplicates.
Logged
Matt Ashland, JRiver Media Center

zxsix

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1753
Re: MCWS API requests
« Reply #7 on: December 07, 2021, 08:12:39 pm »

I was successful using Playlist/Addfile
Thanks for this nice enhancement!   ;D
Logged
Pages: [1]   Go Up