Project

General

Profile

Bug #5930

user config doesn't force DVR profile

Added by Luis Alves about 2 years ago. Updated 7 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-07-23
Due date:
% Done:

0%

Estimated time:
Found in version:
latest git master
Affected Versions:

Description

I have a user configuration entry that has a specific "DVR configuration profile".

When that user creates recordings via Kodi, the DVR configuration is set to "(default config)" instead of the one ticked in the user config.

History

#1

Updated by Flole Systems about 2 years ago

Please specify what version you are using (the exact version number). Latest git master will be inaccurate on the next commit. This will be helpful in case someone looks at the issue in a few months.

#2

Updated by Martin Walter about 2 years ago

Flole Systems: Similar observations here (for reference)
#4

Updated by Dietmar Konermann 8 months ago

Same here with Build: 4.3-1994~gc7b713edb.

The configured recording profile for the a given (restricted) user is simply ignored.
Recordings start with the default profile... should the user have access to that at all?

Cheers
Dietmar.

#5

Updated by Dietmar Konermann 8 months ago

maybe someone likes to try this little hack...

diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c
index 13de1de96..77eb29e0a 100644
--- a/src/dvr/dvr_db.c
+++ b/src/dvr/dvr_db.c
@@ -1036,8 +1036,10 @@ dvr_entry_create(const char *uuid, htsmsg_t *conf, int clone)
   dvr_entry_t *de, *de2;
   int64_t start, stop, create, watched, now;
   htsmsg_t *m;
+  htsmsg_field_t *f;
   char ubuf[UUID_HEX_SIZE], ubuf2[UUID_HEX_SIZE];
   const char *s;
+  access_t *a;

   if (conf) {
     if (htsmsg_get_s64(conf, "start", &start))
@@ -1060,6 +1062,15 @@ dvr_entry_create(const char *uuid, htsmsg_t *conf, int clone)

   de->de_enabled = 1;
   de->de_config = dvr_config_find_by_name_default(NULL);
+  a = access_get_by_username(htsmsg_get_str(conf, "owner") ?: "");
+  if (a->aa_dvrcfgs)
+    HTSMSG_FOREACH(f, a->aa_dvrcfgs) {
+      dvr_config_t *cfg = dvr_config_find_by_uuid(htsmsg_field_get_str(f) ?: "");
+      if (cfg && cfg->dvr_enabled) {
+        de->de_config = dvr_config_find_by_name_default(cfg->dvr_config_name ?: "");
+        break;
+      }
+    }
   if (de->de_config)
     LIST_INSERT_HEAD(&de->de_config->dvr_entries, de, de_config_link);
   de->de_pri = DVR_PRIO_DEFAULT;
#6

Updated by Dreamcat 4 8 months ago

probably someone should raise a PR to fix this

#7

Updated by Christian Hermansen 7 months ago

Dietmar Konermann wrote:

maybe someone likes to try this little hack...

[...]

Thank you for the patch.

I've tried it with version 4.3-2009~g1295dd2be and it seems to be working.

Cheers
Christian

Also available in: Atom PDF