Skip to content

.reload() fails to show updated metadata when 'studio.value' is set to '' (ie, removed) #770

@burchill

Description

@burchill

I was trying to remove (not change) the studio for a given movie, and I noticed something odd. When you pass in **{'studio.value': None [...]} as an arg to edit(), urllib.parse.urlencode encodes the None as a string: 'None', setting the studio name to 'None' rather than removing it.

print(movie.studio)  # 'FakeStudio'
k = {'studio.value': None, 'studio.locked':0}
movie.edit(**k)
movie.reload()
print(movie.studio)  # 'None'  
# NOT None, but the string 'None'

This is kind of annoying, but not horrible (though maybe should be documented).

I found that passing in **{'studio.value': '' [...]} will work instead.

HOWEVER, it took me ages to realize this, because of the bug.

print(movie.studio)  # 'FakeStudio'
k = {'studio.value': '', 'studio.locked':0}
movie.edit(**k)
movie.reload()
print(movie.studio)  # 'FakeStudio'

Although the movie in actuality now has its studio removed, reloading the the movie will display whatever studio it had before, as if it hadn't changed. This appears to be true only when the 'studio.value' key has a value of ''---all other strings will display correctly when updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions