mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
Spotify-style library features for soundtrack tracks: per-user favorites (liked songs) and user-owned playlists with manual ordering and optional public read-only sharing. Track references are stored as (rom_id, md5_hash) rather than rom_file_id: scans purge and re-insert rom_files rows, so file ids churn while rom ids and content hashes are stable. Entries survive rescans and renames, and resolve to the current file at query time; entries whose content is gone are omitted from listings until the file returns. To make the content hash reliably present, soundtrack audio files are now always hashed individually during scans (including NON_HASHABLE_PLATFORMS and SKIP_HASH_CALCULATION, whose file-size concerns don't apply to audio), and soundtrack uploads compute crc/md5/sha1 on write. Existing libraries backfill via a HASHES scan; adding an unhashed track returns 400. New playlists.read/playlists.write scopes are wired through the granular permission system (PermEntity.PLAYLISTS); the migration mirrors every group's collections grants onto the playlists entity so existing groups keep working without admin intervention. Endpoints under /api/music: favorites GET/POST/DELETE, is_favorite and md5_hash on track rows, playlists CRUD, playlist tracks GET/POST/DELETE and PUT /tracks/order.
34 lines
1.5 KiB
Python
34 lines
1.5 KiB
Python
from .client_tokens_handler import DBClientTokensHandler
|
|
from .collections_handler import DBCollectionsHandler
|
|
from .device_save_sync_handler import DBDeviceSaveSyncHandler
|
|
from .devices_handler import DBDevicesHandler
|
|
from .firmware_handler import DBFirmwareHandler
|
|
from .music_playlists_handler import DBMusicPlaylistsHandler
|
|
from .permissions_handler import DBPermissionsHandler
|
|
from .platforms_handler import DBPlatformsHandler
|
|
from .play_sessions_handler import DBPlaySessionsHandler
|
|
from .roms_handler import DBRomsHandler
|
|
from .saves_handler import DBSavesHandler
|
|
from .screenshots_handler import DBScreenshotsHandler
|
|
from .states_handler import DBStatesHandler
|
|
from .stats_handler import DBStatsHandler
|
|
from .sync_sessions_handler import DBSyncSessionsHandler
|
|
from .users_handler import DBUsersHandler
|
|
|
|
db_client_token_handler = DBClientTokensHandler()
|
|
db_collection_handler = DBCollectionsHandler()
|
|
db_device_handler = DBDevicesHandler()
|
|
db_device_save_sync_handler = DBDeviceSaveSyncHandler()
|
|
db_firmware_handler = DBFirmwareHandler()
|
|
db_music_playlist_handler = DBMusicPlaylistsHandler()
|
|
db_permission_handler = DBPermissionsHandler()
|
|
db_platform_handler = DBPlatformsHandler()
|
|
db_play_session_handler = DBPlaySessionsHandler()
|
|
db_rom_handler = DBRomsHandler()
|
|
db_save_handler = DBSavesHandler()
|
|
db_screenshot_handler = DBScreenshotsHandler()
|
|
db_state_handler = DBStatesHandler()
|
|
db_stats_handler = DBStatsHandler()
|
|
db_sync_session_handler = DBSyncSessionsHandler()
|
|
db_user_handler = DBUsersHandler()
|