Project

General

Profile

Actions

Bug #4682

open

TVH not grouping recordings after reboot following filemoved API call

Added by Nic Butcher over 7 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
User Interface
Target version:
-
Start date:
2017-10-24
Due date:
% Done:

0%

Estimated time:
Found in version:
HTS Tvheadend 4.2.3-20 ~ LibreELEC Tvh-addon v8.2.112
Affected Versions:

Description

Introduction

This bug is associated with how recordings are shown in the kodi THEClient addon, in particular how they are grouped.
However, I think the groupings come from TVH server so I am reporting the bug here. If I am wrong then happy to report it to kodi instead.

Normally (if kodi is set to group items) it shows folders corresponding to each programme. Selecting a folder then shows all the episides available for that programme.

However, there appears to be a bug that results in the recordings being shown in a flat list (i.e. not grouped by folders) if the file is moved and there is then a reboot.

Steps to reproduce the bug

In this case TVH is configured with:
Recording system path: /storage/tvshows'
Full pathname specification format string: $t/$t$_e_$c_%F_%R$n.$x
Kodi & TVH are running on the same box (Raspberry PI3 with LibreElec 8.1.2; kodi 17.4 Git:7fc6da0; HTS Tvheadend 4.2.3-20 ~ LibreELEC Tvh-addon v8.2.112)

Step 1 - Have THR record a tv programme. TVH will store the file here: /storage/tvshows/#title#/#filename.ts#
At this point kodi shows the the recording grouped within a folder '#title#' (correct)

Step 2 - The file is then moved (overnight using a script with rsync) to /storage/nas/tv/#title#/#filename.ts#
Note the script also uses the API call dvr/entry/filemoved call to update TVH with the new location.
At this point everything is still working as expected, i.e. kodi shows the the recording grouped within a folder '#title#'

Step 3 - At some time later reboot
Following the reboot, the recordings are no longer grouped within kodi, instead appearing as a flat list.
Interestingly it doesn't need to be a complete reboot - just a restart of kodi (systemctl stop kodi) will cause this behavior - presumably because it re-queries TVH server when it restarts.

Conclusions

TVH presents the grouping to kodi. However the necessary information is not held in the pvr/log file to reconsruct this table correctly following a reboot / restart.

Possible Solutions?

Just my thoughts...
In the short term (v4.2 fix?) TVH could try to reconstruct the grouping from the pvr/log following reboot. I.e. in the above case the #title# is still part of the path. This will solve most cases where users are simply moving files from one location to another.

Longer term it might be better to have two fields within the dvr/log file rather than just filename. I.e. a field for 'system path' and a field for 'file path' File path would be used for grouping. E.g.
system path: /storage/tvshows
file path: /#title#/#filename.ts#
This would give maximum flexibility but need the api and dvr/log structure to be changed

I'd be happy to help with testing if I can be of assistance.

Thanks

Actions

Also available in: Atom PDF