Skip to content

Commit

Permalink
web app: fix bug with overrides
Browse files Browse the repository at this point in the history
When creating an override from the upcoming screen, the values presented
were the defauls instead of the values in the rule being overridden.
  • Loading branch information
bennettpeter committed Jun 24, 2024
1 parent 358e9ad commit 50d1845
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 0 additions & 3 deletions mythtv/html/apps/backend/.gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion mythtv/html/apps/backend/main.js

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions mythtv/html/backend/src/app/schedule/schedule.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class ScheduleComponent implements OnInit {
this.typeList = [];
this.templates = [<RecRule>{ Id: 0, Title: '' }];
this.defaultTemplate = undefined;
if (this.program && this.program.Recording && !newOverride)
if (this.program && this.program.Recording)
recId = this.program.Recording.RecordId;
this.recRules.forEach((entry, index) => {
if (entry.Id == recId) {
Expand All @@ -304,6 +304,14 @@ export class ScheduleComponent implements OnInit {
this.defaultTemplate = entry;
}
});
if (newOverride) {
// This works because RecRule only has elementary items.
this.recRule = Object.assign({}, this.recRule);
this.recRule.ParentId = this.recRule.Id;
this.recRule.Id = 0;
this.recRule.SearchType = 'None';
ruleType = "Override Recording";
}
if (!this.recRule) {
this.recRule = <RecRule>{ Id: 0 };
}
Expand All @@ -320,8 +328,6 @@ export class ScheduleComponent implements OnInit {
if (this.program && this.channel && this.recRule.SearchType == 'None')
this.mergeProgram(this.recRule, this.program, this.channel);

if (newOverride)
this.recRule.ParentId = this.program!.Recording.RecordId;
if (this.reqProgram?.Recording?.StatusName == 'NeverRecord') {
this.neverRecord = true;
ruleType = 'Never Record';
Expand Down

0 comments on commit 50d1845

Please sign in to comment.