Bug #2904
Autorec does not use the recording profile
100%
Description
Hi,
the autorec function always uses the default profile instead of the user configured one.
To test it, just setup an autorec and check the profile use for recording.
Thanks
History
Updated by Jaroslav Kysela over 9 years ago
Does the user have rights for the DVR configuration ?
Updated by The Troll over 9 years ago
Yes it works well when doing a direct recording, but not with the autorecording feature.
Updated by Vojtech Plavecky over 9 years ago
working ok for me on latest master, recording created in the folder defined in dvr profile, pls note dvr profiles got different recording paths, tested on direct recording from tvh web-ui, and with autorecording
Updated by The Troll over 9 years ago
Well that's pretty weird,
it even says "default profile" in the webui for the recording created by autorec, instead of the user profile...
Updated by Vojtech Plavecky over 9 years ago
only %f variable used with Post-Processor Command is not correct, recording path is ok, but extra subdir is not considered, and file name only first word is taken, only /mnt/recorded/TVREC/Muž is taken instead of /mnt/recorded/TVREC/Muž z oceli, file name problem may be related to subdir problem.
Updated by Vojtech Plavecky over 9 years ago
it look like dvr recording profile creating problem ,mine are created ages ago
Updated by Vojtech Plavecky over 9 years ago
working ok also with new profile created, direct recording from webui and also autorec
Updated by The Troll over 9 years ago
So,
if you create a test user with a recording profile different from default
Then you create an autorecording with this user.
In the Upcoming/Current recordings tab, do you see the recording using the user profile for recording ? not the default one ?
Updated by Jaroslav Kysela over 9 years ago
Vojtech: %f is wrong usage - you have to use "%f" if you like to pass the whole filename as one argument. The space is argument splitter.
Updated by Jaroslav Kysela over 9 years ago
Troll: Could you check if you have filled 'owner' and 'creator' fields in the autorec entry ? Also, could you show your autorec config - in ${CFGDIR}/dvr/autorec/* - find the appropriate file there.
Updated by The Troll over 9 years ago
Yes owner and creator is correct (it's the login of the user that has a non-default recording profile).
Here is the autorec content:
{
"enabled": true,
"title": "Boucle Euronews",
"fulltext": false,
"channel": "",
"tag": "",
"start": "Any",
"start_window": "Any",
"start_extra": 0,
"stop_extra": 0,
"weekdays": [
1,
2,
3,
4,
5,
6,
7
],
"minduration": 0,
"maxduration": 0,
"content_type": 0,
"pri": 2,
"record": 0,
"retention": 0,
"config_name": "92fcabb87fe84afb92f9584496987d4a",
"brand": "",
"season": "",
"serieslink": "",
"owner": "transtroll",
"creator": "transtroll",
"comment": "Created from EPG query"
}
where 92fcabb87fe84afb92f9584496987d4a is the passthrough profile.
But here is the transtroll user :
{
"index": 2,
"enabled": true,
"username": "transtroll",
"password2": "...",
"prefix": "0.0.0.0/0,::/0",
"streaming": true,
"adv_streaming": true,
"htsp_streaming": true,
"profile": "04de4eceece633f5d7f60f0be0b15cc5",
"dvr": true,
"htsp_dvr": true,
"all_dvr": true,
"all_rw_dvr": true,
"failed_dvr": true,
"dvr_config": "6e2e7d865abce763baf24698045ec139",
"webui": true,
"admin": true,
"conn_limit": 0,
"channel_min": 0,
"channel_max": 0,
"channel_tag": "",
"comment": "Me transcoded"
}
where 6e2e7d865abce763baf24698045ec139 is the transcoding profile...
Updated by Jaroslav Kysela over 9 years ago
I checked all code flow and I don't see it. Could you check which uuid (the hash) is passed to dvr_entry_create_by_event() in your case ? If you disable/enable the autorec entry, you should hit this routine. Also, verify the uuid in dvr_entry_class_config_name_set() function.
Updated by The Troll over 9 years ago
creating, enable and disable of an autorec does not seem to trigger dvr_entry_create_by_event() :/
Updated by The Troll over 9 years ago
I check dvr_entry_class_config_name_set and i see it called at every recording entry created by the autorec.
It gets the hash of the default profile, not the one from the user...
Updated by Jaroslav Kysela over 9 years ago
The Troll wrote:
creating, enable and disable of an autorec does not seem to trigger dvr_entry_create_by_event() :/
The path is:
dvr_autorec_check_event() or dvr_autorec_changed()
dvr_entry_create_by_autorec()
dvr_entry_create_by_event()
Did you save the enable/disable settings ?
Updated by The Troll over 9 years ago
yes i did, but dvr_entry_class_config_name_set shows the wrong uuid already
Updated by Jaroslav Kysela over 9 years ago
If you see only dvr_entry_class_config_name_set call, then the entry is loaded from dvr/log directory only. The autorec creates new entries using dvr_entry_create_by_autorec() function.
Updated by The Troll over 9 years ago
Hi,
I checked again dvr_entry_create_by_event in the autorec situation and it's indeed called with the wrong UUID, not the one from the user that creates it :/
Updated by The Troll over 9 years ago
Hi,
so after a quick analysis, when I create an autorec:
- api_dvr_autorec_create from src/api/api_dvr.c is called
this function calls:
dvr_autorec_create(const char *uuid, htsmsg_t *conf) from src/dvr/dvr_autorec.c
this function does:
dae->dae_config = dvr_config_find_by_name_default(NULL);
so the default dae config is used ...
am I wrong ?
Updated by Jaroslav Kysela over 9 years ago
It should be overwritten in dvr_autorec_entry_class_config_name_set() with the "config_name" field contents.
Updated by The Troll over 9 years ago
This function is not called when I create an autorec...
Should it be ?
Updated by Jaroslav Kysela over 9 years ago
You must set "DVR Configuration" field in the add dialog...
Updated by The Troll over 9 years ago
OK now I understand where the confusion comes from...
I do not create the autorec using the "autorec/Add" feature!
I just click on autorec in the EPG listing.
So, is it wanted that this patch will use the default profile?
Updated by Jaroslav Kysela over 9 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|4fa2229a6d884b717d50ab9a6d61670d36b9b319.
Updated by Jaroslav Kysela over 9 years ago
You're right. A little piece seems to be missing to select the DVR config from ACL by default like for other DVR entry create calls. It should be fixed in v4.1-124-gbc6efcf .
Updated by The Troll over 9 years ago
I tested your commit and it does not look like to fix it...
dae->dae_config = dvr_config_find_by_name_default(NULL); is still loading the default config
Updated by Jaroslav Kysela over 9 years ago
Right, just forgot one line to set the config_name field correctly.