Release Tag Overview
#1
I've updated this addon to work in Krypton and Leia, and made a few other small improvements.  I haven't tested in Matrix (v19).  Please see the readme before trying.  If you run into problems, I will try to fix.

https://github.com/fnord12/script.tagoverview



== Moderator Edit ==
v19 and later compatible download...
https://github.com/bacon-cheeseburger/sc...agoverview
Maintaining a few add-ons for v18 including PseudoTV (Classic), Tag Overview, and Autosub: https://github.com/fnord12
Reply
#2
(2019-09-07, 20:43)fnord12 Wrote: I've updated this addon to work in Krypton and Leia, and made a few other small improvements.  I haven't tested in Matrix (v19).  Please see the readme before trying.  If you run into problems, I will try to fix.

https://github.com/fnord12/script.tagoverview

Works great here, faster and a little more elegant visually. Will use and report back if I find issues. I am on Libreelec 18.xxx Leia.
Here is the Json to launch it under leia that works in my setup:
jsonrpc?request={"jsonrpc":"2.0","method": "Addons.ExecuteAddon", "params": { "addonid": "script.tagoverview"}, "id": 1 }

many thanks for this!
Reply
#3
Thanks for updating the addon!

For those with MySQL setup. This is how I got it working:
Download mysql-connector-python-8.0.17.tar.gz Source from 
https://pypi.org/project/mysql-connector-python/#files
copy from zip only folder ../lib/mysql/*.* to ../addons/script.tagoverview/mysql

Add database parameters in CDatabase.py
under
class CDatabase:

    baseconfig = {
    }

Add database parameters in MySQLconfig.py
under
class Config(object):

If you run into this error while tagging movies (in my case due to spanish, french and chinese characters)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 43: ordinal not in range(128)

Change getFileInfos in CDialogTagMovies.py file:

    def getFileInfos(self):
        self.filepath = xbmc.getInfoLabel('ListItem.FileNameAndPath').decode("utf-8")
        self.path = xbmc.getInfoLabel('ListItem.Path').decode("utf-8")
        self.name = xbmc.getInfoLabel('ListItem.Label').decode("utf-8")

If the title of the movie does not appear in the window, you need to change the font to Arial under
Settings -> Interface -> Skin -> Fonts -> Arial

I still run into these errors (before the changes), but at least tables <tag> and <tag_link> still look fine.
EXCEPTION: argument "value" for method "setProperty" must be unicode or str

And when trying to add a movie using <Add movie> in the Tag overview window
ERROR: EXCEPTION: Failed to convert to input type to either a std:Confusedtring or a p.XBMCAddon::xbmcgui::ListItem
Reply
#4
Thanks Thanos.  I've incorporated your decoding lines, and I've added your tips for MYSQL to the readme.
Maintaining a few add-ons for v18 including PseudoTV (Classic), Tag Overview, and Autosub: https://github.com/fnord12
Reply
#5
Hi fnord12,

Just a word that this add-on is working great.
Found a minor inconsistency lately. the add-on will not react to tagging of titles that include É, é (e-acute).
.. as in Misérables for example.
Maybe take a look if you work on this again sometime? No biggie, just feeding back this with another thanks!
(edit, removed question)
Reply
#6
First, thanks OP for creating this script.  It's very much appreciated.

I know nothing of python, but have modified this script (by commenting out the key lines) to remove the "new tag" functionality.  What I'm really looking for is a single key press to toggle my "watch later" tag.  It don't want / need the other (cool) functionality. 

With hiding the "New Tag" functionality, I've got it down to three key presses:
1. "T" to bring up the dialog box
2. "Enter" to toggle the "Watch Later" tag
3. "Esc" to exit the dialog box

Does anyone have any hints on how I could modify the script to:
1. Press "T" to toggle my pre-defined "Watch Later" tag.

This would be similar to the toggling of "Watched" status.

I could do some sort of macro with the Harmony remote, but I'd like to do this directly with the script if possible.
Reply
#7
(2019-11-08, 16:58)dvdapex Wrote: First, thanks OP for creating this script.  It's very much appreciated.

I know nothing of python, but have modified this script (by commenting out the key lines) to remove the "new tag" functionality.  What I'm really looking for is a single key press to toggle my "watch later" tag.  It don't want / need the other (cool) functionality. 

With hiding the "New Tag" functionality, I've got it down to three key presses:
1. "T" to bring up the dialog box
2. "Enter" to toggle the "Watch Later" tag
3. "Esc" to exit the dialog box

Does anyone have any hints on how I could modify the script to:
1. Press "T" to toggle my pre-defined "Watch Later" tag.

This would be similar to the toggling of "Watched" status.

I could do some sort of macro with the Harmony remote, but I'd like to do this directly with the script if possible.
Hello,
Perhaps stating the bleeding obvious, but you could very easily achieve this with a key macro editor or if you are using a remote,
some JSON strings which in turn could be the same macro for your remote. Like: t; down; enter; back
I am using Keyboard Maestro, for these types of things, but there might be free alternatives. Good luck.
Reply
#8
Hi @dvdapex.  A quick look at this suggests that in the CThreadTagMovies.py file, you'd have to replace line 14 "wnd.doModal(self.movieId, self.type)" with a call to a new function that checks if the selected item already had the tag.  If it didn't, you'd call CDialogTagMovies.AddTagToItem with your desired tag ID hard-coded in.  Otherwise, you'd call RemoveTagToItem.  The tricky part is checking if the item is already tagged, which shouldn't be TOO hard but might not be worth the effort just to avoid an extra button press or using a macro.

I also think from a UX perspective it would be a little weird because you wouldn't get any kind of visual feedback like you do with watched status (unless you're also customizing your skin).  I'd worry about accidentally untagging a movie you'd already tagged, hitting the button by accident and not knowing, etc..  But since it'd just be for your personal use I guess you wouldn't care.

I can try to help a little more if you really want to go through with it.

@houser , thanks for the feedback.  Looks like another encoding issue that might be solved similarly to the code that @Thanos provided.  I'll try to take a look this week.
Maintaining a few add-ons for v18 including PseudoTV (Classic), Tag Overview, and Autosub: https://github.com/fnord12
Reply
#9
(2019-11-09, 19:53)fnord12 Wrote: Hi @dvdapex.  A quick look at this suggests that in the CThreadTagMovies.py file, you'd have to replace line 14 "wnd.doModal(self.movieId, self.type)" with a call to a new function that checks if the selected item already had the tag.  If it didn't, you'd call CDialogTagMovies.AddTagToItem with your desired tag ID hard-coded in.  Otherwise, you'd call RemoveTagToItem.  The tricky part is checking if the item is already tagged, which shouldn't be TOO hard but might not be worth the effort just to avoid an extra button press or using a macro.

I also think from a UX perspective it would be a little weird because you wouldn't get any kind of visual feedback like you do with watched status (unless you're also customizing your skin).  I'd worry about accidentally untagging a movie you'd already tagged, hitting the button by accident and not knowing, etc..  But since it'd just be for your personal use I guess you wouldn't care.

I can try to help a little more if you really want to go through with it.

@houser , thanks for the feedback.  Looks like another encoding issue that might be solved similarly to the code that @Thanos provided.  I'll try to take a look this week.

Thanks for the info.  I'll have a look and see if I can trial-and-error my way around this based on your nudge.  I'm not particularly worried about accidentally untagging a show, but it is a valid point that I wouldn't have any visual indication as to whether the tagging "took" or not.  I might just go with the macro which will still give me that visual.
Reply
#10
@houser I tried to replicate the problem with e-acute but couldn't.  I tried tagging Les Misérables (2012) and it worked fine and I don't see an error in the log.  Can you do the following:

1. Send me a link from TMDB to a movie that is causing the problem (one is enough if there are multiples).
2.Link me to a debug log, or if you see an obvious error in the log, paste that snippet here.
3.  Let me know if you are using a MySQL set-up.

Thanks!
Maintaining a few add-ons for v18 including PseudoTV (Classic), Tag Overview, and Autosub: https://github.com/fnord12
Reply
#11
(2019-11-22, 06:56)fnord12 Wrote: @houser I tried to replicate the problem with e-acute but couldn't.  I tried tagging Les Misérables (2012) and it worked fine and I don't see an error in the log.  Can you do the following:

1. Send me a link from TMDB to a movie that is causing the problem (one is enough if there are multiples).
2.Link me to a debug log, or if you see an obvious error in the log, paste that snippet here.
3.  Let me know if you are using a MySQL set-up.

Thanks!
Hello fnord12,

Sorry for late reply. Must have missed the notification.
In short I ran some more tests after your post and the issue appears to onlyhappen when running the JSON command rather than the keycommand.
In my case LibreElec latest stable. Les Misérables and Amélie are two movies at TMDB that has this issue.
Not sure if I can find another way to trigger via JSON. Thanks again!
Reply
#12
Hi guys. I'd like to move the Tags menu from inside "Manage" to the main context menu (the one with Add To Favorites, Mark As Watched/Unwatched, etc.) to make it more wife & kid-friendly. It seems the deeper into the menus they go, they more trouble they cause somehow. Does anyone know how to do this that could help with a patch? I know next to 0 python.

Thanks for any help!
Reply
#13
@teriyaki -

In addon.xml (usually under \AppData\Roaming\Kodi\addons\script.tagoverview for Windows), change menu id="kodi.core.manage" to menu id="kodi.core.main"
 
It should take after you quit and restart Kodi.

You also might just look into mapping to a key and avoiding the context menu altogether.   In your keymap.xml file (example is for the T key, you can use whatever you want):

Code:
<keymap>
    <global>
        <keyboard>
              <t>RunScript(script.tagoverview)</t>
       </keyboard>
    </global>
</keymap>
Maintaining a few add-ons for v18 including PseudoTV (Classic), Tag Overview, and Autosub: https://github.com/fnord12
Reply
#14
(2020-04-22, 04:21)fnord12 Wrote: In addon.xml (usually under \AppData\Roaming\Kodi\addons\script.tagoverview for Windows), change menu id="kodi.core.manage" to menu id="kodi.core.main"
 
It should take after you quit and restart Kodi.
That did the trick, thank you @fnord12! All our Kodi's are remote controlled (no keyboard/mouse) so the keymap entry wasn't an option but good to know in case a keyboard user is looking for the same.
Reply
#15
Just a quick note to anyone planning on using this with Kodi 19, it does need some minoring fixing for python3:
Code:
diff -pruN --no-dereference "a/script.tagoverview/CDatabase - Kopie.py" "b/script.tagoverview/CDatabase - Kopie.py"
--- "a/script.tagoverview/CDatabase - Kopie.py" 2020-04-23 15:10:51.401704444 -0700
+++ "b/script.tagoverview/CDatabase - Kopie.py" 2020-04-23 14:42:50.400474330 -0700
@@ -89,7 +89,7 @@ class CDatabase:
     def init_sqlite(self):
         debug("CDatabase init sqlite")
         from sqlite3 import dbapi2 as sqlite
-        print self.config['database']
+        print(self.config['database'])
         if self.config['database'] == None:
             self.config['database'] = self.getSQLiteFileName(VIDEO_SEARCHPATTERN_SQLITE)
         else:
diff -pruN --no-dereference a/script.tagoverview/CDatabase.py b/script.tagoverview/CDatabase.py
--- a/script.tagoverview/CDatabase.py   2020-04-23 15:10:51.401704444 -0700
+++ b/script.tagoverview/CDatabase.py   2020-04-23 14:39:13.399192320 -0700
@@ -90,7 +90,7 @@ class CDatabase:
     def init_sqlite(self):
         debug("CDatabase init sqlite")
         from sqlite3 import dbapi2 as sqlite
-        print self.config['database']
+        print(self.config['database'])
         if self.config['database'] == None:
             self.config['database'] = self.getSQLiteFileName(VIDEO_SEARCHPATTERN_SQLITE)
         else:
diff -pruN --no-dereference a/script.tagoverview/CDialogTagMovies.py b/script.tagoverview/CDialogTagMovies.py
--- a/script.tagoverview/CDialogTagMovies.py    2020-04-23 15:10:51.402704446 -0700
+++ b/script.tagoverview/CDialogTagMovies.py    2020-04-23 14:53:30.235304244 -0700
@@ -68,9 +68,9 @@ class CDialogTagMovies(xbmcgui.WindowXML
         self.player = xbmc.Player()
         self.vdb = CVideoDatabase()
         #self.filepath = decode(xbmc.getInfoLabel('ListItem.FileNameAndPath'))
-        self.filepath = xbmc.getInfoLabel('ListItem.FileNameAndPath').decode("utf-8")
-        self.path = xbmc.getInfoLabel('ListItem.Path').decode("utf-8")
-        self.name = xbmc.getInfoLabel('ListItem.Label').decode("utf-8")
+        self.filepath = xbmc.getInfoLabel('ListItem.FileNameAndPath')
+        self.path = xbmc.getInfoLabel('ListItem.Path')
+        self.name = xbmc.getInfoLabel('ListItem.Label')
         self.dbid = xbmc.getInfoLabel('ListItem.DBID')
         self.entry = "selection"
         #self.dump()
diff -pruN --no-dereference a/script.tagoverview/CVideoDatabase.py b/script.tagoverview/CVideoDatabase.py
--- a/script.tagoverview/CVideoDatabase.py      2020-04-23 15:10:51.402704446 -0700
+++ b/script.tagoverview/CVideoDatabase.py      2020-04-23 14:38:27.383134361 -0700
@@ -12,12 +12,12 @@ class CVideoDatabase:
     def AddToTable(self, table, firstField, secondField, value):
         debug("CVideoDatabase AddToTable")
         sql = "select %s from %s where %s like %s" % (firstField, table, secondField,self.db.pparam)
-        print sql
+        print(sql)
         self.cur.execute(sql,((value),))
         row = self.cur.fetchone()
         if row is None:
             sql = "INSERT INTO %s (%s, %s) values(NULL, %s)" % (table, firstField, secondField, self.db.pparam)
-            print sql
+            print(sql)
             self.cur.execute(sql,((value),))
             self.db.con.commit()
             debug("CVideoDatabase cursor",self.cur.lastrowid)
diff -pruN --no-dereference a/script.tagoverview/addon.xml b/script.tagoverview/addon.xml
--- a/script.tagoverview/addon.xml      2020-04-23 15:10:51.402704446 -0700
+++ b/script.tagoverview-fixed/addon.xml        2020-04-23 14:34:18.269812029 -0700
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.tagoverview" name="Tag Overview" version="0.1.1" provider-name="fnord12 via olivaar">
        <requires>
-               <import addon="xbmc.python" version="2.25.0"/>
+               <import addon="xbmc.python" version="3.0.0"/>
        </requires>
        <extension point="xbmc.python.script" library="default.py">
                <provides>executable</provides>
        </extension>

        <extension point="kodi.context.item">
-    <menu id="kodi.core.manage">
+    <menu id="kodi.core.main">
       <item library="default.py">
         <label>32000</label>
         <visible>String.IsEqual(ListItem.dbtype,movie) | String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,musicvideo)</visible>
diff -pruN --no-dereference a/script.tagoverview/strings.py b/script.tagoverview/strings.py
--- a/script.tagoverview/strings.py     2020-04-23 15:10:51.405704450 -0700
+++ b/script.tagoverview-fixed/strings.py       2020-04-23 14:45:05.247651284 -0700
@@ -81,9 +81,9 @@ def debug(msg, *args):
         else:
             xbmc.log(u"Tag: {0}#{1}#".format(msg, txt).encode('ascii','xmlcharrefreplace'), xbmc.LOGDEBUG)
     except:
-        print "Error in Debugoutput"
-        print msg
-        print args
+        print("Error in Debugoutput")
+        print(msg)
+        print(args)

 def error(msg, *args):
     txt=''
@@ -104,4 +104,4 @@ def decode(string):

 def uc(s):
     return unicode(s, 'utf-8','replace')
-
\ No newline at end of file
+
Reply

Logout Mark Read Team Forum Stats Members Help
Tag Overview0