Connecting to a DB
#16
I want to keep these two separated.

But just to understand - I've never before heard of strm files, wouldn't using .disc files as described in the wiki be an easier way to integrate physical media into the Kodi-DB?
Reply
#17
(2020-12-05, 12:42)vonson Wrote: I want to keep these two separated.

But just to understand - I've never before heard of strm files, wouldn't using .disc files as described in the wiki be an easier way to integrate physical media into the Kodi-DB?
Fair enough. Unsure what disc files are but for physical media converted to digital media, it would make more sense to integrate the media itself as opposed to a strm file that references it.
Reply
#18
yes, but there is no conversion intended, there are no media files. It's all just meant to find a 'label' in a table.

disc files, as far as i understand it, can be used as placeholders in Kodi. they will be read into the database like any media file, but if selected for playback Kodi will display a 'Please insert disc'-message.

But as I said, I do not want to do this. I want to keep digital media and physical media separated.
Reply
#19
(2020-12-05, 13:26)SEIKT Wrote:
(2020-12-05, 12:42)vonson Wrote: I want to keep these two separated.

But just to understand - I've never before heard of strm files, wouldn't using .disc files as described in the wiki be an easier way to integrate physical media into the Kodi-DB?
Fair enough. Unsure what disc files are but for physical media converted to digital media, it would make more sense to integrate the media itself as opposed to a strm file that references it.

I was heading this direction until the answer was that this is physical media and simply wanting a lookup / indexing function.  If the desire was to play the video files with Kodi then inserting into the database was likely an easy answer.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#20
OK, finally I have it working and I am quite pleased with the result so far. Thanks everyone for helping.
Using the side menu  i can even filter the list.

Two more things Id like to do:
Can I add a sort option to the side menu?
Is there a way to have the list displayed and an input box on top of the page that can be used to filter the list (instead of using the side menu)?
Reply
#21
OK, now I run into problems.

I have the path to the csv-file stored in the 'settings.xml' as described in the tutorial. Locally on the windows machine it did work.

Now i tried to swap from using a local csv-file to one stored on the NAS, but now neither can I set the path to the csv-file via the dialog, nor will the android device even read it from the settings even if it is stored in there...
But even if I assign the path directly to the variable (in the addon.py) without useing the settings.xml, it still does not work. 'No such file or directory'
Reply
#22
(2020-12-06, 19:17)vonson Wrote: OK, now I run into problems.

I have the path to the csv-file stored in the 'settings.xml' as described in the tutorial. Locally on the windows machine it did work.

Now i tried to swap from using a local csv-file to one stored on the NAS, but now neither can I set the path to the csv-file via the dialog, nor will the android device even read it from the settings even if it is stored in there...
But even if I assign the path directly to the variable (in the addon.py) without useing the settings.xml, it still does not work. 'No such file or directory'

I am not sure where you are putting your CSV file but I would suggest the database folder.  The look near the top of my mezzmo.py file and you will see a line:

        DB = os.path.join(xbmc.translatePath("special://database"), media.getDatabaseName()) 

Drop the  media.getDatabaseName() and add your file name string and see if that works for you.  I think you can even get away with something as simple as:

mycsvfile = xbmc.translatePath('special://database/mycsvfile.csv')

I haven't tested it.

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#23
(2020-12-06, 03:32)vonson Wrote: OK, finally I have it working and I am quite pleased with the result so far. Thanks everyone for helping.
Using the side menu  i can even filter the list.

Two more things Id like to do:
Can I add a sort option to the side menu?
Is there a way to have the list displayed and an input box on top of the page that can be used to filter the list (instead of using the side menu)?

For your first question, I can't see your code but some of the side panel functionality is based upon media type, view mode and the skin so it can get complex.  I'd suggest starting with setting the media type to video or movie.  See if that gets you what you want.  For the second question, I believe the answer is "no" unless the skin provides it.  I believe you'd have to move away from list items and create your own dialog window.  Someone else can chime in here.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#24
ok, so the searchbox idea is dropped, advanced dialog window fuddling is surely not a good idea if I can barely get the basics running...

For the rest I have to look into your suggestions. You say I could store the csv file in the database folder - do you mean the MariaDB folder? I don't even know where to find and how to access it...

However, I'll be busy the coming days, it might take some time before I am back with more questions...
Reply
#25
(2020-12-07, 23:45)vonson Wrote: ok, so the searchbox idea is dropped, advanced dialog window fuddling is surely not a good idea if I can barely get the basics running...

For the rest I have to look into your suggestions. You say I could store the csv file in the database folder - do you mean the MariaDB folder? I don't even know where to find and how to access it...

However, I'll be busy the coming days, it might take some time before I am back with more questions...

No, I was referring to the Kodi database folder.  Typically /userdata/Database/ under Kodi.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#26
Soooo, after a lot of trial and error, headache and cursing I have sorted out a lot of my problems and things work more or less as I want them to.

the one thing that I cannot get to work is the sorting. You suggested setting the ListItem media type to video - how do I do that? I don't understand the documentation...
Reply
#27
(2020-12-12, 22:06)vonson Wrote: Soooo, after a lot of trial and error, headache and cursing I have sorted out a lot of my problems and things work more or less as I want them to.

the one thing that I cannot get to work is the sorting. You suggested setting the ListItem media type to video - how do I do that? I don't understand the documentation...

That's good to hear and fairly common when you start coding addons.  Did the xbmc.translatePath work for you ? 

To set the lititem media type look at lines 599-623 in my mezzmo.py file.

It will be something like this for you:

                    categories_text = 'video'
                    info = {
                        'duration': getSeconds(duration_text),
                        'genre': genre_text,
                        'year': release_year_text,
                        'title': title,
                        'plot': description_text,
                        'director': creator_text,
                        'tagline': tagline_text,
                        'writer': writer_text,
                        'cast': artist_text.split(','),
                        'artist': artist_text.split(','),
                        'rating': rating_val,
                        'code': imdb_text,
                        'mediatype': categories_text,
                        'season': season_text,
                        'episode': episode_text,
                        'lastplayed': last_played_text,
                        'aired': aired_text,
                        'mpaa':content_rating_text,
                        'studio':production_company_text,
                        'playcount':playcount,
                        'trailer':trailerurl,
                        'tvshowtitle':album_text,
                    }
                    li.setInfo('video', info)

Just remove any of the info dictionary items you don't need or set them to the proper value.  You can remove any or all info dictionary items you don't need except mediatype, which you want to set.  Then change li.setInfo to whatever you called your listitem.

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#28
I could not get it to work with the 'with open' method as in your example when accessing a file on the server; finally I switched to xbmcvfs.File and a for... loop, because this one i could not get to work with 'with'

So do i unverstand you correctly, i set the video type via 'mediatype' in the info section? Is there any reason to do this by a variable instead of directly?
And 'li.setInfo('video', info)' can be set arbitrarily?


EDIT:
stupid question, your addon reads various types of content, that's why you use the variable I guess.

Unfortunately, setting the mediatype in the info section did not change anything, I still cannot sort...
Reply
#29
(2020-12-12, 23:42)vonson Wrote: I could not get it to work with the 'with open' method as in your example when accessing a file on the server; finally I switched to xbmcvfs.File and a for... loop, because this one i could not get to work with 'with'

So do i unverstand you correctly, i set the video type via 'mediatype' in the info section? Is there any reason to do this by a variable instead of directly?
And 'li.setInfo('video', info)' can be set arbitrarily?


EDIT:
stupid question, your addon reads various types of content, that's why you use the variable I guess.

Unfortunately, setting the mediatype in the info section did not change anything, I still cannot sort...

I am not sure what your setinfo values look like but you might try looking here to see ways to force a sort.  I don't know if you want to use the skin to select sort options or just force a particular sort sequence every time.  The examples on the link should be able to help.  Look at some of the xbmcplugin.addSortMethod examples and make sure you add an xbmcplugin.endOfDirectory after inserting your last listitem from your CSV extract.  If this doesn't work we're likely at the point where you'll need to post some of your code.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#30
(2020-12-13, 03:28)jbinkley60 Wrote:
(2020-12-12, 23:42)vonson Wrote: I could not get it to work with the 'with open' method as in your example when accessing a file on the server; finally I switched to xbmcvfs.File and a for... loop, because this one i could not get to work with 'with'

So do i unverstand you correctly, i set the video type via 'mediatype' in the info section? Is there any reason to do this by a variable instead of directly?
And 'li.setInfo('video', info)' can be set arbitrarily?


EDIT:
stupid question, your addon reads various types of content, that's why you use the variable I guess.

Unfortunately, setting the mediatype in the info section did not change anything, I still cannot sort...

I am not sure what your setinfo values look like but you might try looking here to see ways to force a sort.  I don't know if you want to use the skin to select sort options or just force a particular sort sequence every time.  The examples on the link should be able to help.  Look at some of the xbmcplugin.addSortMethod examples and make sure you add an xbmcplugin.endOfDirectory after inserting your last listitem from your CSV extract.  If this doesn't work we're likely at the point where you'll need to post some of your code.


Jeff

I did some testing with my own addon and the xbmcplugin.addSortMethod works great.  For instance I tested with adding these two lines just before the endOfDirectory line:

    xbmcplugin.addSortMethod(addon_handle, xbmcplugin.SORT_METHOD_TITLE)
    xbmcplugin.addSortMethod(addon_handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR)

and the skin gave me these additional sort options to select from.  You can find a full listing of sort options here .  I may add some of this to my addon.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Connecting to a DB0