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 · Fixed by #3044
Closed
Labels
feature features we would like to implement

Comments

@flesk
Copy link

flesk 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+ NULL fields and tag removal #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 features we would like to implement 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
Copy link
Member

sampsyo 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
Copy link

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

@sampsyo
Copy link
Member

sampsyo 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
Copy link

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

@sampsyo
Copy link
Member

sampsyo 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
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
Labels
feature features we would like to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants