fix: a few bugs, support .view urls hopefully
This commit is contained in:
parent
1778ce53cb
commit
159395e35d
4 changed files with 29 additions and 22 deletions
11
Justfile
11
Justfile
|
|
@ -9,6 +9,9 @@ mount:
|
|||
unmount:
|
||||
bash ./mount-tool.sh unmount
|
||||
|
||||
clean:
|
||||
CLEAN=1 bash ./mount-tool.sh unmount
|
||||
|
||||
run: mount
|
||||
RAVE_STORAGE_DIR=/tmp/media-for-rave RAVE_CACHE_DIR=/tmp/cache-for-rave cargo r
|
||||
|
||||
|
|
@ -20,13 +23,13 @@ refresh:
|
|||
sea generate entity -o ./entities/src --with-serde both --date-time-crate time --lib
|
||||
|
||||
scan:
|
||||
curl -vv "http://localhost:1234/rest/startScan?c=supersonic&f=xml&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0" | xq
|
||||
curl -vv "http://localhost:1234/rest/startScan?c=supersonic&f=json&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0" | jq
|
||||
|
||||
scanStatus:
|
||||
curl -vv "http://localhost:1234/rest/getScanStatus?c=supersonic&f=xml&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0" | xq
|
||||
curl -vv "http://localhost:1234/rest/getScanStatus?c=supersonic&f=json&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0" | jq
|
||||
|
||||
getAlbumList2:
|
||||
curl -vv "http://localhost:1234/rest/getAlbumList2?c=supersonic&f=xml&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0&type=newest" | xq
|
||||
curl -vv "http://localhost:1234/rest/getAlbumList2?c=supersonic&f=json&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0&type=newest" | jq
|
||||
|
||||
getAlbum ALBUM:
|
||||
curl -vv "http://localhost:1234/rest/getAlbum?c=supersonic&f=xml&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0&id={{ ALBUM }}" | xq
|
||||
curl -vv "http://localhost:1234/rest/getAlbum?c=supersonic&f=json&s=RTA3MKflcW&t=1058b65692a81c4aac17f5aff879891f&u=admin&v=1.8.0&id={{ ALBUM }}" | jq
|
||||
|
|
@ -18,22 +18,22 @@ function mount_rave {
|
|||
sudo mount /mnt/Media
|
||||
|
||||
# create the overlayfs
|
||||
mkdir -p /tmp/overlay /tmp/work /tmp/media-for-rave
|
||||
mkdir -p /tmp/overlay /tmp/work /tmp/media-for-rave /tmp/cache-for-rave
|
||||
|
||||
# mount the overlayfs
|
||||
fuse-overlayfs -o lowerdir=/mnt/Media/Music -o upperdir=/tmp/overlay -o workdir=/tmp/work /tmp/media-for-rave
|
||||
}
|
||||
|
||||
function unmount_rave {
|
||||
# check if already unmounted
|
||||
if [ ! -d /tmp/media-for-rave ]; then exit 0; fi
|
||||
# check if already unmounted, but only if CLEAN isn't set
|
||||
if [ "${CLEAN:-}" != "1" ] && [ ! -d /tmp/media-for-rave ]; then exit 0; fi
|
||||
|
||||
# unmount the overlayfs
|
||||
umount /tmp/media-for-rave || true
|
||||
|
||||
# clean up the overlayfs if `CLEAN` is set
|
||||
if [ "${CLEAN:-}" = "true" ]; then
|
||||
rm -rf /tmp/overlay /tmp/work /tmp/media-for-rave
|
||||
if [ "${CLEAN:-}" = "1" ]; then
|
||||
rm -rf /tmp/overlay /tmp/work /tmp/media-for-rave /tmp/cache-for-rave || true
|
||||
fi
|
||||
|
||||
# unmount the music directory
|
||||
|
|
|
|||
|
|
@ -27,18 +27,21 @@ mod get_artist;
|
|||
|
||||
pub fn build() -> Box<dyn Endpoint<Output = poem::Response>> {
|
||||
Route::new()
|
||||
.at("/ping", ping::ping)
|
||||
.at("/getLicense", get_license::get_license)
|
||||
.at("/getMusicFolders", get_music_folders::get_music_folders)
|
||||
.at("/getAlbumList", get_album_list::get_album_list)
|
||||
.at("/getAlbumList2", get_album_list::get_album_list)
|
||||
.at("/getAlbum", get_album::get_album)
|
||||
.at("/stream", stream::stream)
|
||||
.at("/startScan", start_scan::start_scan)
|
||||
.at("/getScanStatus", get_scan_status::get_scan_status)
|
||||
.at("/search3", search3::search3)
|
||||
.at("/getCoverArt", get_cover_art::get_cover_art)
|
||||
.at("/getArtists", get_artists::get_artists)
|
||||
.at("/getArtist", get_artist::get_artist)
|
||||
.at("/ping<.view?>", ping::ping)
|
||||
.at("/getLicense<.view?>", get_license::get_license)
|
||||
.at(
|
||||
"/getMusicFolders<.view?>",
|
||||
get_music_folders::get_music_folders,
|
||||
)
|
||||
.at("/getAlbumList<.view?>", get_album_list::get_album_list)
|
||||
.at("/getAlbumList2<.view?>", get_album_list::get_album_list)
|
||||
.at("/getAlbum<.view?>", get_album::get_album)
|
||||
.at("/stream<.view?>", stream::stream)
|
||||
.at("/startScan<.view?>", start_scan::start_scan)
|
||||
.at("/getScanStatus<.view?>", get_scan_status::get_scan_status)
|
||||
.at("/search3<.view?>", search3::search3)
|
||||
.at("/getCoverArt<.view?>", get_cover_art::get_cover_art)
|
||||
.at("/getArtists<.view?>", get_artists::get_artists)
|
||||
.at("/getArtist<.view?>", get_artist::get_artist)
|
||||
.boxed()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ impl From<SubsonicResponse> for SubsonicResponseJson {
|
|||
pub struct SubsonicResponseJson {
|
||||
pub status: ResponseStatus,
|
||||
pub version: VersionTriple,
|
||||
#[serde(flatten)]
|
||||
pub value: Box<SubResponseType>,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue