swingmx / swingmusic

Swing Music is a beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music.
https://swingmx.com
MIT License
678 stars 41 forks source link

Root directory configuration bug #156

Closed AndyZoeng closed 7 months ago

AndyZoeng commented 8 months ago
image

hi Directory configuration can only see these,why?

image
cwilvx commented 8 months ago

Hello @AndyZoeng

Have you tried running the container from the command line?

I can't tell why you are having this issue without additional info. Please provide additional info. eg. your OS, how you're running the container, etc.

MASIJUN99 commented 8 months ago

Hi @mungai-njoroge

i have same problem too. i mounted the directory in container but i cannot find the directory in webui

OS: centos7 Version: latest(1.3.0, see this in settings page) Startup way: docker

here is my docker cmd, copy from README, only change music volume and add -d option

docker run -d --name swing \
...
-v /path/to/mymusic:/music \
....

There has a critial point. i use docker exec -it swing bash enter contaioner, and ls /music, the music lies well in directory.

Interesting, If i change the container directory like -v /path/to/music:/music2 (i tried /home/music /config/music), then i could find /music. in one word, if i volume the directory, that directory cannot be found in directory list in webui.

Additional infomation: the directory /path/to/mymusic is a link to a samba server. the inside content was generated by iTunes i mounted samba server as a directory like /samba and owned it then ln -s /samba/music /path/to/ and finally using docker mounted in swingmusic.

BTW, no useful logs in console, only has useless scanning in console logs.

Hope to resolve, if you need more info, just tell me.

MASIJUN99 commented 8 months ago

Hi @mungai-njoroge

After I push above post I try to find reason.

I try to fetch all request in my chrome and found two request. One of it will show all the selectable directory and other is show the list you have selected

If you select and click submit, the request add root directory(maybe) will post the directories you just selected. Then the directories you just selected will add to the list.

I try create the request by curl and post the /music to server. And it works.

Check the container log, the server starts scanning. I have almost 10k music in that directory, about 40GB.

In my opinion, the directory not shown because the scanning cost lots of time.

I have not check the code, but multithread maybe help. The directory need deep search util it does not have any sub directory. Try multithread and change the logic in the scanning directory. Do not read useless information like music name / album info etc..

Solution I guess and suggest:

  1. Using multi thread to do search.
  2. I see the project write in py and cloud do this scan in c and call c in py. (Hint: see command tree)
  3. Call command tree -d and parse its result.

Addition: my directory contains about 1k directories or sub directories.

cwilvx commented 8 months ago

@MASIJUN99

I have not worked with samba before so I can't tell why this is happening.

I don't think the issue is related to multithreading or the size of the folder at all. The server does not read files, it reads mounted drives. Usually, the /music folder is detected by default. The other folders appearing in the web ui are not checked for music files, they are the mounted drives/folders.

The functionality is implemented with psutils.

However, I've modified the psutil command to check for all drives. Please check whether it will work properly in the next release.

Thanks.

cwilvx commented 8 months ago

@AndyZoeng @MASIJUN99

Can you please check whether the issue is fixes on the latest v1.4.0 release

MASIJUN99 commented 7 months ago

@AndyZoeng @MASIJUN99

Can you please check whether the issue is fixes on the latest v1.4.0 release

@cwilvx hi,

sorry for lately reply, im busy in work.

i dont have poetry env in my server, i could use docker only.

and i try to pull tag 1.4.0, but failed with Error response from daemon: manifest unknown

MASIJUN99 commented 7 months ago

@cwilvx

i successful to execute docker pull ghcr.io/swing-opensource/swingmusic:latest, and it pull a images just now.

i run it again and it run normally.

here is some features i expected, and maybe i could to do something for help if you need.

  1. album or artist views instead folders
  2. auto fill the empty album and artist images, such as call last.fm api
  3. remote client

BTW, this issue maybe should be closed.

MASIJUN99 commented 7 months ago

here is my running snapshots.

image

cwilvx commented 7 months ago

Hello @MASIJUN99

It's nice to hear that your initial issue has been resolved. Thank you for the feature requests, we'll consider them.