RocketMan / zookeeper

Zookeeper Online is a music database and charting application for student and independent radio.
GNU General Public License v3.0
4 stars 3 forks source link

Add optional time parameter to playlist duplication #381

Closed RocketMan closed 1 year ago

RocketMan commented 1 year ago

This PR adds an optional fromtime parameter to the playlist duplication/rebroadcast API. The value may be a range (hhmm-hhmm) or a time (hhmm). If you specify a time, the API copies from the specified time to the end of the playlist.

Example:

Playlist 12345 runs from 0000-0300. To duplicate only one hour of this playlist 0100-0200 for rebroadcast on 2022-01-01 at 1800-1900:

 POST /api/v1/playlist HTTP/1.1
 X-APIKEY: eb5e0e0b42a84531af5f257ed61505050494788d
 Content-Type: application/vnd.api+json

 {
   "data": {
     "type": "show",
     "attributes": {
       "rebroadcast": true,
       "date": "2022-01-01",
       "time": "1800-1900"
     },
     "meta": {
       "fromtime": "0100-0200"
     },
     "relationships": {
       "origin": {
         "data": {
           "type": "show",
           "id": "12345"
         }
       }
     }
   }
 }

More details are available in docs/Playlists.md