Skip to content

Commit

Permalink
refactor: add api/backend/proc-macro crate (#412)
Browse files Browse the repository at this point in the history
* add song orm name media ibz

* move genres to metadata

* move compilation to artists

* add song orm data

* add albums orm

* pass data to file

* fix unused position

* move orm out of schema

* rename filesystem_type/file_type to ty

* rename media file to media audio

* rename media to file

* rename audio type to audio format

* rename filesystem_type to ty

* add file property

* rename test media to file

* rename dump to audio dump

* add songs upsert orm

* add test song update roundtrip

* add upsert trait

* fix clippy warning

* remove size out of entry

* break down argument in add audio

* rename audio to extract

* use path instead of relative path

* create path instead of concat string

* add file

* rename property::File to file::Property

* use file to read audio

* fix unique albums and split upsert trait

* intially add scan::run

* initial support genres

* add new type for genres

* add songs_genres

* initial add support for orm artist

* remove unused cow

* add compute artist index

* add artist upsert

* add song album artist and song artist orm

* use indexset to store artists

* move all select_* to query

* add test for artists upsert

* add information upsert

* move all tests out of orm

* add initial test for information upsert

* add check for stale song album artists

* add delete old data while upserting

* add config for index ignore prefixes

* add upsert and cleanup to scanner

* add audio hashmap into music folder mock

* save relative path in audios

* add initial test for scan

* set scanned at for song update

* use album type name instead of name date mbz

* add test for song overwrite/update

* add test for remove song

* add artist global cleanup

* use music folder directly in scanner

* add upsert mock information

* add generic path to add audio music folder

* add test for artist cleanup

* add intial album cleanup

* add fake information to mock

* add album cleanup test

* add genres cleanup

* add genres cleanup test

* add scan route

* add delay to now because postgres precision

* make scanner works while having duplicated audios

* add test for move audio

* cargo fmt + clippy

* rename scanner test

* rename audio to filesystem

* add add database audio to music folder

* add test combine album artist

* remove unused arg in add audio

* add detect request and response for api derive

* add mime

* add initial binary response

* add binary endpoint

* add song retriever

* add response property

* add permission to retriever query

* initial read to binary

* change retriever to binary source

* add download endpoint

* use offset as option

* add range header to download

* add test for download

* add more header test for download

* rename response to http

* rename binary to response

* move offset to header

* use s3 duration as duration

* initial transcoder implementation

* add compile time enable/disable hearing test

* add media retrieval format

* add format output for transcode

* add transcode config

* move transcode to a module folder

* add new format trait to nghe_api

* add replace method to property

* remove diesel 64 column

* use utf8native for local path only

* use faster hex to parse token

* add property path

* add transcode sink

* add stream api request

* switch to use loole instead of tokio

* add transcoder spawn

* add http property trait

* add stream api handler

* allow use loole unbounded

* fix config parsing

* allow get no auth

* fix parsing transcode format

* correct mime type for opus

* use property for seekable and cache control

* add stream transcode logic

* add write to file for sink and initial stream test

* add tracing for transcode

* add transcode status header

* fix clippy warning

* add trace to scanner

* fix leak span in scanner

* change transcode input from cstring to string

* fix stream acquire lock file issue

* fix sink write logic

* use fs4 to lock file

* add test for serve cached output transcode

* add test stream time offset

* add database config table

* add started_at to scanner run tracing

* implement database config for index ignore prefixes

* add api request/response get artists

* initial add id3 artist query

* add upsert mock for artist

* add to api type for artist

* add id3 artist test query multiple music folders

* add filter music folder with permission for artist

* add handler for browsing/get_artists

* add id3 artist role

* fix deserialize index config

* add proc macro for check music folder permission

* add default partialeq/eq/partialord/ord derive for api

* add test for browsing/get artists

* add user_id helper function in mock

* add api for browsing/get_music_folders

* add permission query with album and with music folder id

* add browsing/get_music_folders handler

* add mock helper function music_folder_id

* move auth parameter for post request to body

* fix serde_html_form serialize can not serialize unit struct

* add cors layer and ping endpoint

* use fold to implement check music folder instead of replace string

* allow disable json/binary routers

* allow disable json/binary api endpoint

* simpler role authorization

* add system/get_open_subsonic_extensions

* upgrade axum to 0.8.0-alpha.1

* simpler api derive

* add api album id3

* add api browsing/get_artist

* add id3 artist with albums query

* use api builder for orm id3

* api: add album id3

* backend/browsing: add handler get artist

* mock: add audio artist

* backend/browsing: add test for query artist with albums

* backend/browsing: add test for get_artist handler

* backend/orm/id3: fix album query duration

* backend/orm/id3: move artist to module folder

* api/id3: move album/artist mod to folder

* api/browsing: add api for get_album

* backend/orm/id3: rename artist with albums to with albums

* backend/orm/id3: add album with artists songs

* backend/orm/id3: add album with artists songs query and implmentation

* backend/browsing: add get_album handler

* api/id3: fix case where date should not be skip

* backend/browsing: stricter test for get_artist

* backend/browsing: add test sorted for get_album

* backend/orm/id3: add test for album with artsts songs

* api/id3: split required out of artist

* backend/orm/id3: fix test for with artists songs

* backend/orm/id3: rename id duration to duration

* backend/orm/id3: add struct for query required vector

* api/id3: add artists to song

* backend/orm/id3: add convert duration trait

* mock/music_folder: rename query id to song id filesystem

* backend/orm/id3: add test for query song

* api/id3: add api get_song

* backend/browsing: add handler get_song

* Revert "backend/orm/id3: fix test for with artists songs"

This reverts commit 5c26beb.

* backend/orm: fix sorted test with song track number

* backend/orm/id3: add test genres for with_album_genres

* backend/browsing: add test for get song handler

* api/browsing: add api for get genres

* backend/orm: change permission music folder id to music folder

* backend/orm/id3: rename try into api and builder to try into

* backend/browsing: add get_genres handler

* api/list: add api for get_album_list2

* misc: replace crate::error::Error with crate::Error

* backend/lists: add partial handler for get_album_list2

* api/lists: use display from str for by year in get_album_list2

* api/id3/media_annotation: add api for scrobble

* proc-macro: automatically derive endpoint for struct with name Request

* backend/media_annotation: add handler for scrobble

* backend/lists: implement missing case for get_album_list2 handler

* api/browsing: add api/handler for get_album_info2

* backend/orm/id3: fix album with durations with music folder

* backend/lists: add api/handler for get_random_songs

* misc: use orm instead of schema

* backend/lists: fix not nullable query in get_album_list2

* backend/browsing: add api/handler for get_top_songs

* backend/browsing: add api/handler for get_artist_info2

* dev: use rand reexported from fake

* backend: initial add support for embed picture

* chore: bump rust toolchain to nightly-2024-11-22

* backend/picture: add upsert/dumb/load for picture

* backend/orm/songs: use Foreign struct for representing album_id

* backend/audio: information upsert take scanner config

* backend/config: add cover art config

* backend/information: add upsert cover art

* api/common: add typed_uuid

* backend/orm/id3: add cover_art to song

* backend/media_retrieval: add api/handler for get_cover_art

* backend/error: convert diesel notfound to notfound status

* api/id3: add required for builder

* backend/orm: rename album with artists songs to full

* backend/orm: rename artist with albums with full

* backend/orm: rename song with album genres to full

* backend/orm: rename album with duration to short

* backend/orm: add cover_art to album

* backend/config: add config for cover art folder file names

* backend/filesystem: add exists

* backend/scanner: add scan dir cover art

* backend/deps: update typed-path to 0.10.0 fork for copyable

* backend/scanner: add scanned dir cover art to database

* backend/mock: add information mock

* backend/mock: replace audio::Information with mock Information

* backend/picture: move scan dir to picture

* misc: enable str_as_str feature

* backend/mock: add builder for information

* backend/mock: add information dir picture

* backend/mock: move music folder write file to information dump

* backend/scanner: add test scan dir picture and fix test duplication

* chore: remove derivative with educe

* backend/file: ignore data in debug for picture

* backend/scanner: add recompute dir picture to fix scanner tests

* backend/orm: add test for query cover art

* backend/search: add api/handler for search3
  • Loading branch information
vnghia authored Nov 27, 2024
1 parent 6685925 commit 41db73f
Show file tree
Hide file tree
Showing 285 changed files with 15,448 additions and 78 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ PKG_CONFIG_PATH_x86_64-unknown-freebsd = { value = "target/vcpkg/installed/x64-f
PKG_CONFIG_PATH_x86_64-apple-darwin = { value = "target/vcpkg/installed/x64-osx-release/lib/pkgconfig", relative = true }
PKG_CONFIG_PATH_aarch64-apple-darwin = { value = "target/vcpkg/installed/arm64-osx-release/lib/pkgconfig", relative = true }

OPENSSL_STATIC = { value = "true" }

# Only Windows uses vcpkg linking.
VCPKGRS_TRIPLET = { value = "x64-windows-static-release" }
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# Hearing test output
hearing-test-output/

# End of https://www.toptal.com/developers/gitignore/api/c++,rust,linux,macos,windows,rust-analyzer,visualstudiocode,direnv
Loading

0 comments on commit 41db73f

Please sign in to comment.