sentriz / gonic

music streaming server / free-software subsonic server API implementation
ircs://irc.libera.chat/#gonic
GNU General Public License v3.0
1.49k stars 105 forks source link

Genre split and podcast download issue #473

Closed mattiasghodsian closed 4 months ago

mattiasghodsian commented 4 months ago

gonic version: 0.16.2 type: docker image: sentriz/gonic:nightly

I currently have 2 problems with my gonic setup.

  1. I cant seem to get genre to split using comma, When adding GONIC_MULTI_VALUE_GENRE="delim ," i get a warning in the log that its not set
  2. podcasts cant be downloaded and stored in path.
    gonic_1  | 2024/02/20 13:21:45 failed to download podcast: do download: create audio file: open /podcasts/DavidBombal/1749519044100234930668013b2.mp3: no such file or directory
    gonic_1  | 2024/02/20 13:21:49 failed to download podcast: do download: create audio file: open /podcasts/DavidBombal/17630949441002b9fda5039d3ac.mp3: no such file or directory
    gonic_1  | 2024/02/20 13:21:55 failed to download podcast: do download: create audio file: open /podcasts/DavidBombal/18217555441002b1804b5719f9b.mp3: no such file or directory
    gonic_1  | 2024/02/20 13:21:59 failed to download podcast: do download: create audio file: open /podcasts/DavidBombal/182182394410023dc1df6b3c49.mp3: no such file or directory
    gonic_1  | 2024/02/20 13:22:04 failed to download podcast: do download: create audio file: open /podcasts/DavidBombal/183981114410023c3fb629d92f3.mp3: no such file or directory

gonic directory files from host view

drwxr-xr-x  5 root  root   5 Feb 20 12:45 ./
drwxr-xr-x 12 user1 user1 12 Feb 20 12:45 ../
drwxr-xr-x  4 root  root   4 Feb 20 12:45 cache/
drwxr-xr-x  2 root  root   2 Feb 20 12:45 playlists/
drwxr-xr-x  2 root  root   2 Feb 20 12:45 podcasts/

start up log

gonic_1  | 2024/02/20 13:21:39 starting gonic v0.16.2
gonic_1  | 2024/02/20 13:21:39 provided config
gonic_1  | 2024/02/20 13:21:39     cache-path                /cache
gonic_1  | 2024/02/20 13:21:39     config-path               
gonic_1  | 2024/02/20 13:21:39     db-path                   /data/gonic.db
gonic_1  | 2024/02/20 13:21:39     exclude-pattern           
gonic_1  | 2024/02/20 13:21:39     expvar                    false
gonic_1  | 2024/02/20 13:21:39     genre-split               
gonic_1  | 2024/02/20 13:21:39     http-log                  true
gonic_1  | 2024/02/20 13:21:39     jukebox-enabled           false
gonic_1  | 2024/02/20 13:21:39     jukebox-mpv-extra-args    
gonic_1  | 2024/02/20 13:21:39     listen-addr               :80
gonic_1  | 2024/02/20 13:21:39     multi-value-album-artist  multi
gonic_1  | 2024/02/20 13:21:39     multi-value-artist        multi
gonic_1  | 2024/02/20 13:21:39     multi-value-genre         multi
gonic_1  | 2024/02/20 13:21:39     music-path                /music
gonic_1  | 2024/02/20 13:21:39     playlists-path            /playlists
gonic_1  | 2024/02/20 13:21:39     podcast-path              /podcasts
gonic_1  | 2024/02/20 13:21:39     podcast-purge-age         0
gonic_1  | 2024/02/20 13:21:39     pprof                     false
gonic_1  | 2024/02/20 13:21:39     proxy-prefix              /
gonic_1  | 2024/02/20 13:21:39     scan-at-start-enabled     false
gonic_1  | 2024/02/20 13:21:39     scan-interval             5
gonic_1  | 2024/02/20 13:21:39     scan-watcher-enabled      true
gonic_1  | 2024/02/20 13:21:39     tls-cert                  
gonic_1  | 2024/02/20 13:21:39     tls-key                   
gonic_1  | 2024/02/20 13:21:39     version                   false

docker-compose.yml

version: "2.4"
services:
  gonic:
    image: sentriz/gonic:nightly
    command: sh -c "while :; do sleep 3600; find /cache -type f -atime +90 -delete; done & gonic"
    ports:
      - 4533:80
    volumes:
      - ./data:/data 
      - /tattoine/media/music:/music:ro 
      - /tattoine/gonic/podcasts:/podcasts
      - /tattoine/gonic/playlists:/playlists 
      - /tattoine/gonic/cache:/cache
    environment:
      - TZ=Europe/Stockholm
      - GONIC_SCAN_INTERVAL=5
      - GONIC_GENRE_SPLIT=,
      - GONIC_SCAN_WATCHER_ENABLED=1
      - GONIC_MULTI_VALUE_ARTIST=multi
      - GONIC_MULTI_VALUE_ALBUM_ARTIST=multi
      #- GONIC_MULTI_VALUE_GENRE="delim ,"
    group_add:
      - audio
    devices:
      - /dev/snd:/dev/snd

    restart: unless-stopped
sentriz commented 4 months ago

I cant seem to get genre to split using comma, When adding GONIC_MULTI_VALUE_GENRE="delim ," i get a warning in the log that its not set

what is the error that you get?

mattiasghodsian commented 4 months ago

I cant seem to get genre to split using comma, When adding GONIC_MULTI_VALUE_GENRE="delim ," i get a warning in the log that its not set

what is the error that you get?

- GONIC_MULTI_VALUE_GENRE="delim ,"

gonic_1  | 2024/02/20 14:17:00 error parsing args: error parsing env vars: error setting flag "multi-value-genre" from env var "GONIC_MULTI_VALUE_GENRE": unknown multi value mode "\"delim". should be "none" | "multi" | "delim <delim>"; error setting flag "multi-value-genre" from env var "GONIC_MULTI_VALUE_GENRE": unknown multi value mode "\"". should be "none" | "multi" | "delim <delim>"
sentriz commented 4 months ago

can you try this in your docker compose instead

environment:
- "GONIC_MULTI_VALUE_GENRE=delim ,"
mattiasghodsian commented 4 months ago
- "GONIC_MULTI_VALUE_GENRE=delim ,"

same issue

sentriz commented 4 months ago

whats the error message this time?

maybe try just

environment:
- GONIC_MULTI_VALUE_GENRE=delim ,
mattiasghodsian commented 4 months ago

whats the error message this time?

maybe try just

environment:
- GONIC_MULTI_VALUE_GENRE=delim ,

i did that previews with same result

sentriz commented 4 months ago

with the same error message? are you sure you did a docker compose up?

mattiasghodsian commented 4 months ago
- GONIC_MULTI_VALUE_GENRE=delim ,
user1@tattoine:~/docker/app/gonic$ docker-compose up
Starting gonic_gonic_1 ... done
Attaching to gonic_gonic_1
gonic_1  | 2024/02/20 15:19:21 error parsing args: error parsing env vars: error setting flag "multi-value-genre" from env var "GONIC_MULTI_VALUE_GENRE": no delimiter provided for delimiter mode; error setting flag "multi-value-genre" from env var "GONIC_MULTI_VALUE_GENRE": unknown multi value mode "". should be "none" | "multi" | "delim <delim>"
gonic_1  | 2024/02/20 15:19:22 error parsing args: error parsing env vars: error setting flag "multi-value-genre" from env var "GONIC_MULTI_VALUE_GENRE": no delimiter provided for delimiter mode; error setting flag "multi-value-genre" from env var "GONIC_MULTI_VALUE_GENRE": unknown multi value mode "". should be "none" | "multi" | "delim <delim>"
gonic_gonic_1 exited with code 1
sentriz commented 4 months ago

what is the output of docker inspect <gonic container name> | jq ".[].Config.Env"

sentriz commented 4 months ago

ohh, i know what the issue is

mattiasghodsian commented 4 months ago

docker inspect | jq ".[].Config.Env"

[
  "TZ=Europe/Stockholm",
  "GONIC_SCAN_INTERVAL=5",
  "GONIC_GENRE_SPLIT=,",
  "GONIC_SCAN_WATCHER_ENABLED=1",
  "GONIC_MULTI_VALUE_GENRE=delim ,",
  "GONIC_MULTI_VALUE_ARTIST=multi",
  "GONIC_MULTI_VALUE_ALBUM_ARTIST=multi",
  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "GONIC_DB_PATH=/data/gonic.db",
  "GONIC_LISTEN_ADDR=:80",
  "GONIC_MUSIC_PATH=/music",
  "GONIC_PODCAST_PATH=/podcasts",
  "GONIC_CACHE_PATH=/cache",
  "GONIC_PLAYLISTS_PATH=/playlists"
]
sentriz commented 4 months ago

hi, the issue is that the config parser gonic uses treats , as a multi item delimiter (for example multiple music dirs)

i've just updated it to a version that supprots escapting the delimiter with \

so you should be able to write

GONIC_MULTI_VALUE_GENRE=delim \,

as for the podcast issue, as fix was pushed

unfortunately the nightly builds are broken since #467 so you'll have to wait for that