UPnP/DLNA files have 1969 timestamp and cannot mark as played

Hi, I realized that files on a DLNA source always have a 12/31/1969 timestamp and “mark as played” has no effect (brief pause and long-filename horizontal scroll reset, but file does not disappear if directory is configured to show only unplayed).

This is the case both on the OSMC and Estuary skins.

Files on a local SD card source have the correct timestamp and “mark as played” has the correct effect.

What is the likely source of the problem or at least difference in behavior between local SD and DLNA sources? The DLNA server (Gerbera) is presenting correct metadata on the files:

osmc@osmc:~/.kodi/userdata/Database$ curl -I http://10.0.1.233:49153/content/media/object_id/505853/res_id/0/ext/file.mp4
HTTP/1.1 200 OK
CONTENT-LENGTH: 970087940
Accept-Ranges: bytes
CONTENT-TYPE: video/mp4
DATE: Sat, 23 Dec 2023 21:51:22 GMT
LAST-MODIFIED: Mon, 21 Jan 2019 16:03:24 GMT
SERVER: Linux/5.10.0-26-amd64, UPnP/1.0, Portable SDK for UPnP devices/17.5.0
X-User-Agent: redsonic
contentFeatures.dlna.org: DLNA.ORG_PN=AVC_MP4_EU;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000
transferMode.dlna.org: Streaming
CONNECTION: close

The answer here is likely a bit complicated but let me try to explain. Kodi’s resume pointers and playcounters are stored in the Kodi video database. When you browse a UPnP / DLNA server you get those values from the server, not the Kodi database. Here’s a sample of code from the Mezzmo Kodi addon to illustrate the XML parsing of the play counter from the server and this is the resume pointer code

The reason it works this way is so that resume pointers, playcounters and similar are shared across all Kodi and non-Kodi clients vs. the Kodi video database which is just for the local instance. In my case I have 7 Kodi clients running the Mezzmo Kodi addon (with different versions of Kodi) to stay in sync with the server and multiple non-Kodi clients (i.e. android, web etc…). Here’s a performance test with 6 Blu-Ray and 4k streams running simultaneously.

So the challenge is that when you use the native Kodi context menu controls for clearing bookmarks, setting played status and such you are setting it in the Kodi database and not the UPnP server. So if you are in native mode in Kodi browsing your library things will look right but when you browse your UPnP server you won’t see the results of your Kodi context menu changes.

To get around this problem you need a context menu item that does both, sends the change to the UPnP / DLNA server and also sets the Kodi database value. That way regardless of whether you are browsing the UPnP server or viewing your Kodi library you see matched values. This is regardless of the Kodi skin.

I accomplish this in the Mezzmo Kodi addon with a Mezzmo context menu which has a number of rich features. So when you clear the bookmark / resume pointer or change the play status it does it for both the Mezzmo server (via a SOAP call) and Kodi.

I hope this helps a little.

Thanks,

Jeff

1 Like

Will the Kodi v19 addon work with OSMC at Kodi v20.2? I didn’t see any builds for a newer Kodi on the github releases page. I tried this version of the plugin but it didn’t discover my server.

When I put the IP address in manually having no other options, I’m then presented with a list of server types to select from, and Gerbera (or mediatomb) is not on the list. Not sure if I’ve missed something or if it just means Gerbera is not supported.

Kodi 20.2 is supported and yes the 19+ version supports through the upcoming Kodi 21. I’ve not tested Gerbera but it should autodiscover. It won’t be able to be manually added until we can determine the connection URI for it. Did you disable the Only Show Mezzmo Servers option under the addon View settings ? If not, it will get discovered but not displayed.

You can look in the Kodi.log file when you start the addon or the general log viewer and it will show you what UPnP servers were discovered.

Thanks,

Jeff

1 Like

Okay, I tried this again and disabled that view setting - I was able to get into Gerbera via the addon. How should this work from here? Would I need to always browse for media through the Mezzmo addon menu rather than the “Movies” tab on the main menu (in this case, in the Kodi Estuary skin)? I tried doing that initially, and when checking out a particular MKV file in the Mezzmo addon browser, the name and thumbnail were shown, but neither the “left side”/directory context menu nor the file context menu seemed to be any different from the Kodi context menus observed when browsing through the menu menu “Movies” tab UPnP browser.

Also, I tried as a test to set the file as watched, and like with the Kodi menu, there was a 1 second UI pause, but it did not appear to take effect (the file was still shown only when the Unwatched or All filters were selected, but not when the Watched filter was selected).

Also, there is a popup when entering the addon settings saying “No Mezzmo sync server selected”. Should this message concern me?

Thanks for the guidance.

In UPnP mode with non-Mezzmo servers you won’t get all the functionality as running with a Mezzmo server. So in UPnP mode you need to browse through the addon and not the Movies tab because it will not add a source to Kodi. It only does this with a Mezzmo server where it actually syncs the Mezzmo database with Kodi. No, you don’t need to worry about the Mezzmo sync server missing because you aren’t running with a Mezzmo server and so it cannot sync.

I am sorry if I wasn’t clearer about updating the watched status and broader context menu. They too only work with a Mezzmo server. I don’t know if a Gebera server has the ability to set the play count or resume pointer via DLNA. Again there is no standard for this. A Mezzmo server provides an API to allow this capability.

Thanks,

Jeff

1 Like

I did think of a couple of things. First, you can add a faviourite from within the addon so that you can launch to a specific playlist or folder from Kodi. This would be equivalent of clicking in the movie section with the native Kodi UPnP browsing.

The other thing I thought of is I could add the autostart feature to the UPnP section. Right now it just is enabled with Mezzmo. This could allow Kodi to automatically start in the addon and at the specific point you desire. I typically use this on my Kodi instances and have it start on my Mezzmo server at the Video playlist / folder. If this is of interest I can look to add it in the next release which will be coming out next week.

Thanks,

Jeff