While it's handy to have a named folder for music uploads, it's generally preferred to have references in form of IDs instead of user-defined values. The current approach has implications when renaming slugs in certain scenarios.
Therefore the uploads should be stored in a folder named after the Show ID.
Additionally Tank is using the slug in API endpoints provided to Dashboard. Here the showId should be used too.
how the models for File and Playlist use the slug/show name as reference,
how the store handles the files and the playlists,
the routes that use the slug/show name as URL or query parameter.
An additional problem is going to be the migration of the already stored files: There is no link between the slug/show name used to store the files and the id of a show in steering.
Thanks for the analysis, Ernesto. Most points sound actually not too hard to change imo. Only the auth scope topic, can you please explain what's the hard part here, when using the showId instead of the showSlug?
Migrations can be happily ignored, since there are no production instances yet.
The scope ticket in steering is actually the easy part.
The remaining parts are more complicated than you think.
The requests are checked for authorization for a show in at least 21 places, this needs to be done carefully.
As you can see here, the shows table has name as primary key, that is referenced by both playlists and files, the change from name to id touches not only the models but also all the functions that do the create/update/delete the shows, files and playlists.
I can count at least 48 places where the show is referenced as a string (slug) in the importer and store modules.