Fixed: Update list if item was deleted from database but not from disk #4182

Merged
merged 1 commit into from Feb 10, 2014

Projects

None yet

4 participants

@Black09
Team Kodi member

After the context menu changes the container wasn't properly refreshed anymore if an item was deleted from the database but not removed from disk. This fixes it as DeleteVideoItem needs to return true if DeleteVideoItemFromDatabase returns true.

@t-nelson

Won't the item just be readded on the next scan?

@Black09
Team Kodi member

Yes it would. But anyway if the item is not in the db anymore (even if it's just temporary), the list has to be updated which is even the case because if you go to the home screen and back to movies, the movie is gone... it's just not removed immediately and this fixes it.

@jmarshallnz
Team Kodi member

Looks fine.

@jmarshallnz jmarshallnz merged commit 7e5e765 into xbmc:master Feb 10, 2014
@Black09 Black09 deleted the Black09:delete-update-fix branch Feb 10, 2014
@t-nelson

Wouldn't it make more sense to do a CanDeleteVideoItem() at ln1306, then only actually delete the item from the db if the delete from FS succeeds? I'm guessing we lose an error dialog the way this is? If not, there should certainly be some feedback to the user that the requested operation has failed.

@t-nelson

Oh... merged already... k

@Black09
Team Kodi member

Good point, I don't know if it's really necessary to have this 2-way delete. Maybe we could change it after Gotham if there is no real use case for deleting something from the db but not from the filesystem.

@jmarshallnz
Team Kodi member

No, you can remove stuff from the library without deleting it from disk (e.g. if the setting isn't enabled to delete stuff from disk you can still remove things from the library). They will, ofcourse, come back later on during another scan however.

@t-nelson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment