Extend gettagindex api
henryk86 opened this issue · 5 comments
As necessary adaptions of current implementation to support the feature request:
toniebox-reverse-engineering/teddycloud_web#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)
…
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.
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 toniebox-reverse-engineering/teddycloud_web#80
The getTagInfo API should be adapted in the same way.
All requested features implemented now already