robweber / xbmcbackup

Backup Addon for Kodi
MIT License
107 stars 48 forks source link

[Bug] Show Information for unwatched items #169

Closed Blurayx closed 3 years ago

Blurayx commented 3 years ago

Hi, when episode thumb is deselected. After a restore, backup re-enables episode thumb

Kodi v18.9, Android, macOS Big Sur v11.1

After a restore backup re-enables episode thumb

screenshot001

screenshot000

robweber commented 3 years ago

Thanks for pointing this out. I took a look at the settings definition for that particular setting (below). Looks like this particular setting is expecting a list value in the form [1,2] but the addon is trying to set it as a string like "1,2". Most likely an oversight on my part as I do see a list value type in the JSON-RPC description. I did a quick test and sending an array does set the value correctly. There are probably others like this, I'll have to take a closer look and see how to best code this. I'm guessing it might be time to abandon parsing the guiesettings.xml file directly and instead dump the contents of the Settings.GetSettings JSON call.

I'll get something together in the next few days.


{
"control": {
"delayed": false,
"format": "string",
"multiselect": true,
"type": "list"
},
"default": 0,
"enabled": true,
"help": "Show information for unwatched media in the video library or hide them if not selected to prevent spoilers. Available options are 'Movie plot', 'Episode plot' and 'Episode thumb'.",
"id": "videolibrary.showunwatchedplots.definition",
"label": "Show information for unwatched items",
"level": "basic",
"options": [
  {
"label": "Movie plot",
"value": 0
},
  {
"label": "Episode plot",
"value": 1
},
  {
"label": "Episode thumb",
"value": 2
}
],
"parent": "",
"type": "integer",
"value": 0
},
Blurayx commented 3 years ago

Thanks😀

robweber commented 3 years ago

If you have time please check the PR referenced above. It should solve your problem as well as provide a better way of handling the UI settings in general. The write up should explain the differences - however I do need to mention that this is a change that will work for all backups going forward. In order to test it you'll need to make a backup, change the setting, and then do a restore to test the settings update. I enhanced the backups by capturing the UI settings in a more uniform way, so this new code will just be skipped on old backups. Note that it is possible to run a restore and just don't select any backup sets (hit OK) to only update settings without messing with other stuff.

I'll let this sit for a few days if you have time to test it. Only good for Matrix unfortunately I'll consider back-porting to Leia once this is merged in. This won't help the Kodi repo though as the Krypton version is the only one in the repos at the moment due to the fact that Leia addons need to be Python2/3 compatible and my Leia version is strict python 2 while the Matrix version is only python 3.

Blurayx commented 3 years ago

I'm currently not Matrix because most of the add-ons I use don't work but I gave it a test drive and I am happy to report it's now saving the selected/unselected "show information for unwatched items" Thank you very much for fixing it so quickly 😀

I have two more questions but I'm not sure if it's a Kodi/backup/hardware limitation.

1) Backup resets "Advance" back to "standard" after a restore.Backup before a restore

Backup before a restore

Screenshot 2020-12-02 at 00 41 32

After a restore

Screenshot 2020-12-02 at 00 58 28

2)backup to USB works on macOS but not Nvidia Shield TV. I get a warning "destination may not be writeable" screenshot000

robweber commented 3 years ago

Is that settings level issue also on Leia? I tried it just now on Matrix and the level stayed where I had set it after a restore. I did some digging and this isn't something you can set via python. It appears to be an entry in guiesettings.xml file but not a JSON settable one. I'll try an older system still on Leia when I have some time.

Regarding the write error. Are you using compression? That can make a difference in the backup process. Many times on Android systems local destinations (even USB sticks) come up against permission errors with the OS. The underlying app (Kodi) won't have permission to write to these locations. The write error itself stems from the addon trying to copy 1 file as a test before doing the whole backup. If it can't copy the file you see the error.

Blurayx commented 3 years ago

Thanks for getting back😀 Sorry i forgot to mention, I’m using Leia Regarding writing permission it’s without compression.

robweber commented 3 years ago

Just FYI I ported these over to Python2 for Krypton/Leia installs as well. Minor differences due to things that exist in Matrix but not other versions but overall the same. Feel free to test if you'd like. I'll merge both of these in after a day or so to make sure I can test properly.

Blurayx commented 3 years ago

Leia 18.9 "Show Information for unwatched items" restore settings works perfectly. I wasn't expecting a Leia version. Thank you 😀