toniebox-reverse-engineering / teddycloud

teddyCloud is an open source server replacement for the Boxine Cloud
https://toniebox-reverse-engineering.github.io/docs/tools/teddycloud/
GNU General Public License v2.0
369 stars 29 forks source link

Extend gettagindex api #190

Open henryk86 opened 2 weeks ago

henryk86 commented 2 weeks ago

As necessary adaptions of current implementation to support the feature request:

https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/80

… This also needs some backend modifications. Currently only one of them is attached to the uid, this must be extended to a second one (like adding a child tag with the src one and same structure). To be checked how this will work with Original ones, but I assume both will be equal.

or overwork it a little that there are multiple images available (model one for cover and a second image for src). All other stuff like tonieinfo should be fetched from source if available (and filled from model if not set on src level) …

henryk86 commented 2 weeks ago

it could be like this:

{
  "ruid": [tag.ruid (unchanged)],
  "uid": [tag.uid (unchanged)],
  "type": [tag.tag (unchanged)],
  "valid": true,
  "exists": true,
  "live": false,
  "nocloud": false,
  "hasCloudAuth": true,
  "hide": false,
  "claimed": true,
  "source": "lib://by/audioID/1655213844.taf",
  "audioUrl": "/content/download/XXXXXXX/500304E0?overlay=XXXXXXXX&skip_header=true",
  "tagPicture": [new! pic from model assignment]
  "tonieInfo": {
    "tracks": [ 
         [tracks from src or if nothing in src then from model]
    ],
    "model": [from model assignement],
    "series": [series from src or if nothing in src then from model],
    "episode":  [episode from src or if nothing in src then from model],
    "picture":  [pic from src or if nothing in src then from model],
    "language":  [language from src or if nothing in src then from model]
  }
}

so actually only 1 new element (tagPicture), all other information unchanged or changed to be fetched primarily from the src.

henryk86 commented 1 week ago

or to have both, add a new section sourceInfo with the same element as the tonieinfo. maybe thats the most easiest approach, so in frontend can be decided what should be shown:

{
  "ruid": [tag.ruid (unchanged)],
  "uid": [tag.uid (unchanged)],
  "type": [tag.tag (unchanged)],
  "valid": true,
  "exists": true,
  "live": false,
  "nocloud": false,
  "hasCloudAuth": true,
  "hide": false,
  "claimed": true,
  "source": "lib://by/audioID/1655213844.taf",
  "audioUrl": "/content/download/XXXXXXX/500304E0?overlay=XXXXXXXXX&skip_header=true",
  "tonieInfo": {
    "tracks": [ 
         [tracks from model, no change to now]
    ],
    "model": [from model assignement, no change to now],
    "series": [series from model, no change to now],
    "episode":  [episode from model, no change to now],
    "picture":  [pic from model, no change to now],
    "language":  [language from mode, no change to nowl]
  },
 "sourceInfo": {
    "tracks": [ 
         [tracks from src ]
    ],
    "model": [empty or remove this tag],
    "series": [series from src],
    "episode":  [episode from src],
    "picture":  [pic from src],
    "language":  [language from src]
  }
}

this approach is currently used in https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/80

henryk86 commented 1 week ago

The getTagInfo API should be adapted in the same way.

henryk86 commented 1 week ago

https://github.com/toniebox-reverse-engineering/teddycloud/issues/188

This should be considered here also.