beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.88k stars 1.82k forks source link

Permissions plugin doesn't affect directory permissions #2611

Closed uberjew666 closed 7 years ago

uberjew666 commented 7 years ago

Problem

When using the Permissions plug, it doesn't change the permission from 755 to 775 on directories even though specified in the config. File permissions are successfully altered.

Running this command in verbose (-vv) mode:

simon:~$ beet -vv user configuration: /home/simon/.config/beets/config.yaml data directory: /home/simon/.config/beets plugin paths: Sending event: pluginload lyrics: Disabling google source: no API key configured. library database: /storage/media/Music/.beets/musiclibrary.blb library directory: /storage/media/Music/Sorted Sending event: library_opened

Setup

My configuration (output of beet config) is:

directory: /storage/media/Music/Sorted library: /storage/media/Music/.beets/musiclibrary.blb

plugins: permissions fetchart embedart lyrics lastgenre zero scrub

paths: default: $albumartist/$album%aunique{}/$track-$title singleton: $albumartist/$album%aunique{}/$track-$title comp: Various Artists/$album%aunique{}/$disc$track-$title albumtype:live: $albumartist/$album%aunique{}/$disc$track-$title

import: move: yes copy: no write: yes resume: no log: beets.log

threaded: yes art_filename: folder

ui: color: yes

edit: itemfields: track title artist album albumfields: album albumartist

musicbrainz: host: localhost:5000 ratelimit: 5

fetchart: auto: yes cautious: yes cover_names: cover front albumart folder minwidth: 500 enforce_ratio: yes sources: google itunes amazon coverart albumart google_key: AIzaSyCQOEwdnVSxdEZgdWx-uSvB3z3Dx2yRB6U

embedart: auto: yes

lastgenre: auto: yes force: no

zero: fields: month day comments disc disctotal composer tracktotal update_database: true

scrub: auto: yes

permissions: file: 0664 dir: 0775

uberjew666 commented 7 years ago

Traceback (most recent call last): File "/usr/local/bin/beet", line 11, in sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/beets/ui/init.py", line 1256, in main _raw_main(args) File "/usr/local/lib/python2.7/dist-packages/beets/ui/init.py", line 1243, in _raw_main subcommand.func(lib, suboptions, subargs) File "/usr/local/lib/python2.7/dist-packages/beets/ui/commands.py", line 934, in import_func import_files(lib, paths, query) File "/usr/local/lib/python2.7/dist-packages/beets/ui/commands.py", line 911, in import_files session.run() File "/usr/local/lib/python2.7/dist-packages/beets/importer.py", line 325, in run pl.run_parallel(QUEUE_SIZE) File "/usr/local/lib/python2.7/dist-packages/beets/util/pipeline.py", line 445, in run_parallel six.reraise(exc_info[0], exc_info[1], exc_info[2]) File "/usr/local/lib/python2.7/dist-packages/beets/util/pipeline.py", line 358, in run self.coro.send(msg) File "/usr/local/lib/python2.7/dist-packages/beets/util/pipeline.py", line 171, in coro task = func(*(args + (task,))) File "/usr/local/lib/python2.7/dist-packages/beets/importer.py", line 1463, in manipulate_files task.finalize(session) File "/usr/local/lib/python2.7/dist-packages/beets/importer.py", line 563, in finalize self._emit_imported(session.lib) File "/usr/local/lib/python2.7/dist-packages/beets/importer.py", line 589, in _emit_imported plugins.send('album_imported', lib=lib, album=self.album) File "/usr/local/lib/python2.7/dist-packages/beets/plugins.py", line 452, in send result = handler(*arguments) File "/usr/local/lib/python2.7/dist-packages/beets/plugins.py", line 124, in wrapper return func(args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/beetsplug/permissions.py", line 120, in fix os.chmod(util.syspath(path), dir_perm) OSError: [Errno 1] Operation not permitted: '/storage/media/Music/Sorted/American Head Charge'

sampsyo commented 7 years ago

Hmm; I'm a little confused… is the traceback the problem, or is silent failure the problem?

If the former, it looks like the root cause may be that the permissions couldn't be changed. Can you show the current permissions on that directory with ls -l?

Also, please edit your comments to surround terminal pastes with ``` so they get formatted correctly.

uberjew666 commented 7 years ago

It's sorted. User error. -_- Files were owned by another user so when I ran beet import, it would move the album folder but error on applying folder permissions. File permissions seem to be fine.

Though I also have fetchart enabled and permissions does not apply the correct permission to that :(

Thanks anyway!