v20 ListItem.setInfo() to InfoTagVideo migration discussion - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: v20 ListItem.setInfo() to InfoTagVideo migration discussion (/showthread.php?tid=369255) |
RE: ListItem.setInfo() to InfoTagVideo migration discussion - zachmorris - 2023-02-15 As an aside, for these properties I think a future Kodi version could clean this up more. date InfoTagVideo has SetPremiered, setFirstAired, setYear InfoTagMusic has setReleaseDate and setYear InfoTagPicture has setDateTimeTaken but not setYear InfoTagGame has setYear, but not setReleaseDate date seems like it could go away completely assuming the tags for each InfoTag type are cleaned up and more or less common. In general, it seems like a setPremeriedYear can be abstracted from SetPremiered and a setFirstAiredYear could be abstracted from setFirstAired (i.e you set one and they're both set, but you also have the ability to seperately set just the *Year assuming the *Premiered or *FirstAired is unknown). count InfoTagVideo has setPlaycount InfoTagMusic has setPlaycount InfoTagPicture has nothing equivalent InfoTagGame has nothing equivalent count seems like it could go away completely assuming the tags for each InfoTag type are cleaned up and all have an equivalent setPlaycount overlay Nothing has an equivalent, but looking at the docs I dont even understand what this is used for size Nothing has an equivalent, but I think this is pretty obviously a good thing to be able to tag for each type of item to identify it's size (in bytes) RE: ListItem.setInfo() to InfoTagVideo migration discussion - jbinkley60 - 2023-02-15 (2023-02-15, 03:18)zachmorris Wrote: size I am curious on this one. I have never set the size value on a listitem and from everything I can see there is no Kodi database value for it in any table. The Kodi players don't require it for playing an item and things like streams won't have a size value. I agree it seems like it should be something of value but it isn't even a Kodi smart playlist variable to filter on. I am missing the use case but it feels like it should be obvious. Thanks, Jeff RE: ListItem.setInfo() to InfoTagVideo migration discussion - zachmorris - 2023-02-15 (2023-02-15, 04:21)jbinkley60 Wrote:(2023-02-15, 03:18)zachmorris Wrote: size I currently use it in IAGL so the user can sort by size if they like (xbmcplugin.SORT_METHOD_SIZE), and use a custom window that will show the user the size of the file before they download it. Coincidentally, i shoe horn the addon to show the listitems as video's mainly because the InfoTags that are available for videos are more plentiful, and many of them fit right in with Games, and because Games are not in the Kodi database (yet? One can dream). RE: ListItem.setInfo() to InfoTagVideo migration discussion - jbinkley60 - 2023-02-15 (2023-02-15, 05:19)zachmorris Wrote: I currently use it in IAGL so the user can sort by size if they like (xbmcplugin.SORT_METHOD_SIZE), and use a custom window that will show the user the size of the file before they download it. Coincidentally, i shoe horn the addon to show the listitems as video's mainly because the InfoTags that are available for videos are more plentiful, and many of them fit right in with Games, and because Games are not in the Kodi database (yet? One can dream). Thanks for curing my curiosity. I normally add sort methods like date, title (ignore the), duration etc. I have never considered size and since I don't populate it in the listitems it wouldn't have worked anyway Jeff ListItem.setInfo() to InfoTagVideo migration discussion - jurialmunkey - 2023-02-16 @zachmorris Date I currently already redirect to setPremiered etc on this assumption Count != playcount. As far as I understand count is used as a positioning ID for sorting purposes (eg a sort of "rank" value). There's no equivalent. Size obviously no equivalent. Overlay *used to* be used to set watched status in Listitem.Overlay (value 4&5 was OverlayWatched.png and OverlayUnwatched.png). However I'm fairly sure this is now depreciated and does nothing in Nexus. The listitem.overlay icon appears to be now solely determined by playcount for episodes/movies/videos mediatype and by unwatchedepisodes count for tvshows/seasons mediatype. Which is how it should be imho. RE: ListItem.setInfo() to InfoTagVideo migration discussion - jurialmunkey - 2023-02-22 (2023-01-21, 14:12)bbaron Wrote: @jurialmunkey i have another deprecated message which is not implemented in your script: @bbaron - I ended up deciding to implement something for resume_time which will be in update to next version v0.0.5 https://github.com/jurialmunkey/script.module.infotagger/commit/60237e006454be30f20c9a087753b04c0a551e11 Should be fairly straight forward. It requires your infoproperty key names to be named "ResumeTime" and "TotalTime" (case sensitive).
However, there is an option to change these key names if your infoproperties dictionary uses lowercase or camelCase instead. You can also change pop_keys to False if you don't want to pop them for whatever reason.
I'll make a PR for official repo once I sort out a solution for the above discussion with Zach about count/size/date etc. RE: ListItem.setInfo() to InfoTagVideo migration discussion - jbinkley60 - 2023-02-22 Has anyone looked at the differences between listitem.setInfo for pictures and InfoTagPicture ? There doesn't seem to be much, if any, correlation between the two. For instance setInfo has title, picturepath and exif. InfoTagPicture has setResolution and setDateTimeTaken. So like setArt it can be combination of the two methods under Kodi 20 or leave as setInfo until additional tags are implemented in the future for InfoTagPicture. Thanks, Jeff RE: ListItem.setInfo() to InfoTagVideo migration discussion - zachmorris - 2023-03-05 (2023-02-22, 04:19)jurialmunkey Wrote: I'll make a PR for official repo once I sort out a solution for the above discussion with Zach about count/size/date etc. I tried modifying your script in a similar way for size/date but couldn't figure out a pythonic way to add a custom attribute to the builtin getVideoInfoTag/getMusicInfoTag/getGameInfoTag, or to reroute the setting of those specific keys back to the listitem directly. It seems like we'd have to add a custom attribute to the builtin, and in my googling / stackexchanging I couldn't figure it out. RE: ListItem.setInfo() to InfoTagVideo migration discussion - jurialmunkey - 2023-03-25 (2023-03-05, 19:43)zachmorris Wrote:(2023-02-22, 04:19)jurialmunkey Wrote: I'll make a PR for official repo once I sort out a solution for the above discussion with Zach about count/size/date etc. @zachmorris Sorry it took me a while to get to this. v0.0.7 of infotagger is now in the official repo. I ended up going with a slightly different approach that collects up these old infolabels into a dictionary so they can be set in one go via setInfo rather than individually manage them. If you just use the ListItemInfoTag like previously then it will simply skip count/size/date. However, there's also a new "set_info_tag()" method which handles creating ListItemInfoTag object, setting count/size/date via listitem.setInfo(), and then setting other infolabels via new methods. It returns the ListItemInfoTag object so that you can use it to set other things like cast or stream details rather than needing to remake it. Usage:
See here for how it works: https://github.com/jurialmunkey/repo-scripts/blob/ec289d839143ee70be9e7dcf1794a686355ed750/script.module.infotagger/resources/modules/infotagger/listitem.py#L9-L20 RE: ListItem.setInfo() to InfoTagVideo migration discussion - zachmorris - 2023-03-26 Thanks, I'll give it a try. Also take note that another PR for infotags has been added that may effect infotagger: https://github.com/xbmc/xbmc/pull/23055 RE: ListItem.setInfo() to InfoTagVideo migration discussion - jurialmunkey - 2023-03-27 (2023-03-26, 02:43)zachmorris Wrote: Thanks, I'll give it a try. Also take note that another PR for infotags has been added that may effect infotagger: Ah that's interesting. If I'm reading it correctly, I don't think it'll affect infotagger too much though. As far as I gather, that's about setting the full info tag back to an existing listitem to ensure it updates in memory. You can always get the info tag from infotagger by the _info_tag internal attribute. So then you simply pass it back to that setter ie li.setVideoInfoTag(info_tag._info_tag) RE: ListItem.setInfo() to InfoTagVideo migration discussion - jbinkley60 - 2024-10-30 (2023-01-27, 16:54)jbinkley60 Wrote: A question here regarding getVideoInfoTag() and a whether there is a getTags function to get the associated tags for an item. Looking at the Wiki page I only see a setTags function and no getTags function. I could use an RPC call or a direct database query but was hoping I could use getVideoInfoTag() to get the associated tags. I know I brought this up quite a while ago but I've had another use for it arise and checking the documentation it still doesn't show a getTags method like setTags for InfoTagVideo. Does anyone know if this is planned for a future release or do I need to post a request ? Thanks, Jeff |