How are videos linked to movie/show info in the .ztb file databases?

Discussion in 'General Development' started by RasterEyes, Jul 3, 2023.

Tags:
  1. RasterEyes

    RasterEyes Member

    I'm trying to figure out how the links between media files and poster wall metadata are stored. I'd like to be able to manually change and update this info, or write my own code to perform automated tasks on the data.

    I can easily see how the info describing media files is stored, and how the info for movie/TV show descriptions is stored, but nothing that clearly links these two things.

    Here's what's inside a .ztb backup file if you unzip its contents:

    ├── README.TXT
    ├── app_Temp
    │ └── play.zplist
    ├── app_certification
    │ ├── movie
    │ └── tv
    ├── app_device
    │ └── usb
    ├── app_textures
    ├── app_webview
    │ ├── GPUCache
    │ │ ├── index
    │ │ └── index-dir
    │ │ └── the-real-index
    │ ├── Web Data
    │ ├── Web Data-journal
    │ ├── blob_storage
    │ │ └── 4e4bbbb5-2e86-4b21-9eb5-3e54ae60de9a
    │ ├── metrics_guid
    │ ├── webrtc_event_logs
    │ └── webview_data.lock
    ├── databases
    │ ├── cc
    │ │ └── cc.db
    │ ├── theater.db
    │ └── ua.db
    └── shared_prefs
    ├── Alvin2.xml
    ├── ContextData.xml
    ├── TheaterConfig.xml
    ├── WebViewChromiumPrefs.xml
    ├── config.xml
    ├── umeng_general_config.xml
    ├── youtubedl-android.xml
    └── zcp.xml


    The theater.db file looks to be where most of the relevant information is stored. There is, for instance, a table called VIDEO_INFO that contains paths to media files, and lots of extracted meta data about video format, audio tracks, etc. There are, however, no columns in the table which clearly point to corresponding rows in the MOVIE_INFO or TV_SHOW_INFO tables with which each video file might have been matched.

    The MOVIE_INFO has a column with a promising name, VIDEO_IDS, but in my DB this is always NULL, not anything like a list of IDs in the VIDEO_INFO table.

    I had hoped to find a separate table or tables with entries that linked IDs from these various tables together, but I haven't seen anything that clearly does that. The AGGREGATION table seems the most hopeful for that, but I can't see any clear patterns that make sense in terms of related IDs from the other tables.

    Does anyone else know how this is supposed to work, or where I can find documentation about this?
     
  2. McBluna

    McBluna Well-Known Member

  3. RasterEyes

    RasterEyes Member

    Thanks. I find this diagram a little confusing for answering the questions I have, but I'll to work through it.
     
  4. McBluna

    McBluna Well-Known Member

    You can use my Home Theater DB Tool to export your database to Excel. May be I'll have time tomorrow to explain the database.
     
  5. RasterEyes

    RasterEyes Member

    I was just taking another stab at working with the Zidoo database, so I came back to this thread to check the diagram which had been posted here. That diagram seems to have disappeared, with nothing but [IMG] in it's place. Do images time out after a while here?

    I'm trying to fix the problem of missing technical metadata (frame rate, audio format, etc., as opposed to actor/director/rating metadata).

    I discovered wherever badges weren't displayed (beyond the MKV badge) on the poster wall for particular videos, that matching entries in the VIDEO_INFO table had a 0 for DURATION and TYPE. I'm not sure what TYPE is, but its value is 32 for most videos that I see. DURATION is the duration of a video in milliseconds (although consistently a multiple of 1000, indicating rounding to whole seconds even though millisecond resolution is available.)

    These videos, despite the 0 DURATION, had correct media info in the MEDIA_JSON_TAG field.

    I tried fixing DURATION to a correct value, and changing TYPE to 32, then restoring the modified database. This unfortunately had no effect on the missing badges, however, even though another change I made (modifying the description of a video) indicated that I was successfully making DB changes that I could read back in.

    Does anyone have any idea what part of the DB might be clinging to outdated metadata or video durations? I also noticed that wherever the poster wall displays nothing but an MKV badge, it also display no duration for the selected video.
     
  6. McBluna

    McBluna Well-Known Member

    In the table VIDEO_INFO the columns LAST_WATCH_TIME and DURATION are for the "watched" state.
    For episodes there is no column for duration, so I guess HT4 gets it from mediainfo stored in table VIDEO_INFO column MEDIA_JSON. For movies there is a column RUNTIME in table MOVIE_INFO, but I'm not sure if this is used or HT4 uses duration from mediainfo.
     

Share This Page