RandomNinjaAtk / docker-lidarr-extended

lidarr-extended :: Lidarr application packaged with multiple scripts to provide additional functionality
GNU General Public License v3.0
279 stars 25 forks source link

[Bug]: PUID & PGID set by environmental variables not applying to downloaded/imported files #217

Closed sea3pea0 closed 1 year ago

sea3pea0 commented 1 year ago

Music Videos imported to library as user/group root even though PUID & PGID are set in docker compose file (I haven't tried audio download from the scripts yet so I don't know if this is also the case for audio)

Since my library is owned by user/group 1000 and the plex docker container is set to PUID=1000 & PGID=1000, plex doesn't have permission to access the files imported by docker-lidarr-extended. I have to manually change ownership to allow plex to access the files downloaded by docker-lidarr-extended. As a work around I could set up a post-process script to change ownership but this wouldn't be ideal

To Reproduce Steps to reproduce the behavior: Docker Compose Entry:

  lidarr:
    image: randomninjaatk/lidarr-extended:latest
    container_name: lidarr
    volumes:
      - /mytorrentdownload:/downloads:shared
      - /myconfig:/config
      - /mybackups:/backups:shared
      - /mylidarrextended:/downloads-lidarr-extended
      - /mymusic:/music
      - /mymusicvideos:/music-videos
    environment:
      - TZ=Pacific/Honolulu
      - PUID=1000
      - PGID=1000
      - enableAudioScript=true
      - enableVideoScript=true
      - scriptInterval=15m
      - configureLidarrWithOptimalSettings=false
      - searchSort=date
      - audioFormat=native
      - audioBitrate=lossless
      - requireQuality=true
      - enableReplaygainTags=true
      - audioLyricType=deezer
      - dlClientSource=deezer
      - arlToken=[SECRET]
      - tidalCountryCode=US
      - addDeezerTopArtists=false
      - addDeezerTopAlbumArtists=false
      - addDeezerTopTrackArtists=false
      - topLimit=10
      - addRelatedArtists=false
      - numberOfRelatedArtistsToAddPerArtist=5
      - lidarrSearchForMissing=true
      - addFeaturedVideoArtists=false
      - plexUrl=http://x.x.x.x:32400
      - plexToken=[SECRET]
      - youtubeSubtitleLanguage=en
      - enableQueueCleaner=false
      - matchDistance=5
      - enableBeetsTagging=true
      - beetsMatchPercentage=90
      - retryNotFound=90
      - webHook=https://discord.com/api/webhooks/[SECRET]

Expected behavior Files and folders created/downloaded by docker-lidarr-extended to the /mylidarrextended:/downloads-lidarr-extended and then imported to /mymusicvideos:/music-videos expected to have the ownership set by:

      - PUID=1000
      - PGID=1000

Log Data No log data regarding setting file/folder ownership found

Docker Info:

RandomNinjaAtk commented 1 year ago

The files are not being chown'd but are set to chmod 666 permissions, which should allow anyone to read/write, see here: https://github.com/RandomNinjaAtk/docker-lidarr-extended/blob/26bb17f76343b23d1df8c9e99800df391dd09caa/root/scripts/Video.sh#L449

If plex cannot access them, its likely some other problem with your setup because the permissions that are set are pretty open and others would have reported it by now...

sea3pea0 commented 1 year ago

You're correct, the chmod 666 is sufficient to allow plex access. I just had to refresh metadata for the files to show up in plex. Which brings me to another issue. Is refreshing metadata in plex the only way to get newly added music videos to show in plex? A simple library scan is not doing it in my case

RandomNinjaAtk commented 1 year ago

What your describing is a Plex issue and the answer is yes...

If you started with an empty library and only used the scripts, it's designed to process an artists videos collection first before audio as a workaround. You could report the issue with Plex but who knows if they'll do anything about it.

sea3pea0 commented 1 year ago

Gotcha, thanks for your help. I'll close this issue since it's mostly a non issue. Just curious though as to why not chown files to the user/group set by PUID/PGID?