Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify: Field deletion (foo!) should work for fixed attributes by setting them to null #2497

Closed
flesk opened this issue Mar 28, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@flesk
Copy link

commented Mar 28, 2017

Problem

foo! works if foo is a flexible field, but it doesn't do anything if it's a fixed attribute.

Example from IRC Chat:

User not able to delete/reset artpath: to "None" as modify only results in artpath being the current working directory:

# beet modify -a 2cellos artpath!
Modifying 1 albums.
No changes to make.
# beet modify -a 2cellos artpath=''
Modifying 1 albums. 
2CELLOS - 2Cellos
  artpath: /media/music/processed/2CELLOS/2011 - 2Cellos/cover.jpg -> /root  
Really modify, move and write tags? (Yes/no/select) n 

Led to this problem:

artpath: /media/music/processed/2CELLOS/2011 - 2Cellos/cover.jpg -> /root  

should be:

artpath: /media/music/processed/2CELLOS/2011 - 2Cellos/cover.jpg -> None

Setup

  • OS: Linux bedmoode 4.4.30-v7+ #919 SMP Tue Nov 1 16:57:28 GMT 2016 armv7l GNU/Linux
  • Python version: Python 3.4.2
  • beets version: beets version 1.4.4
  • Turning off plugins made problem go away (yes/no): no

@sampsyo sampsyo added the feature label Mar 28, 2017

@sampsyo sampsyo changed the title foo! only working for flexible field, not fixed attribute modify: Field deletion (foo!) should work for fixed attributes by setting them to null Mar 28, 2017

@sampsyo

This comment has been minimized.

Copy link
Member

commented Mar 28, 2017

Thanks! All attributes (including fixed attributes) have a null value. We should just use that when using beet modify foo!.

@camsteffen

This comment has been minimized.

Copy link

commented Mar 10, 2018

It seems confusing to me that it says "Modifying 1 albums" and then "No changes to make". Is this a bug?

@sampsyo

This comment has been minimized.

Copy link
Member

commented Mar 11, 2018

That is odd! But perhaps it’s the case that your query marched one album but the new field value was equal to the old field value? That would explain it.

@camsteffen

This comment has been minimized.

Copy link

commented Mar 11, 2018

I think it happens any time you use field! on an inflexible field

@sampsyo

This comment has been minimized.

Copy link
Member

commented Mar 11, 2018

Ah, indeed, because we currently don’t actually change anything when that happens. So the bug is this one, I’d say!

djl added a commit that referenced this issue Sep 27, 2018

Allow "deleting" fixed attributes via `beet modify`.
Deleting a fixed field isn't possible so we just reset the
field back to it's "null" value.

Fixes #2497.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.