Skip to content

Commit

Permalink
added local artwork only toggle in exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed Mar 28, 2023
1 parent 04aba84 commit cd7c858
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/lang/en-US/langStrings.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@
},
"text": {
"title": "User Exceptions",
"exclude": "Exclude Title"
"exclude": "Exclude Title",
"excludeArtwork": "Local Artwork Only"
}
},
"service": {
Expand Down
5 changes: 4 additions & 1 deletion src/lib/file-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,13 @@ export class FileParser {
if(exceptions && exceptions.commandLineArguments) {
parsedConfig.files[j].argumentString = exceptions.commandLineArguments;
}
if(exceptions && exceptions.searchTitle) {
if(exceptions && !exceptions.excludeArtwork && exceptions.searchTitle) {
parsedConfig.files[j].onlineImageQueries = [exceptions.searchTitle];
parsedConfig.files[j].imagePool = exceptions.searchTitle;
}
if(exceptions && exceptions.excludeArtwork) {
parsedConfig.files[j].onlineImageQueries = [];
}
}
parsedConfig.files = parsedConfig.files.filter(x=>!!x);
resolve({ config: config, settings: settings, parsedConfig: parsedConfig });
Expand Down
3 changes: 2 additions & 1 deletion src/models/language.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ export interface languageStruct {
},
text: {
title: string,
exclude: string
exclude: string,
excludeArtwork: string
}
},
service: {
Expand Down
3 changes: 2 additions & 1 deletion src/models/user-exceptions.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export interface UserExceptionsTitles {
newTitle: string,
searchTitle: string,
commandLineArguments: string,
exclude: boolean
exclude: boolean,
excludeArtwork: boolean
}
}
export interface UserExceptions {
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/user-exceptions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export class ExceptionsComponent implements OnDestroy {
newTitle:'',
searchTitle:'',
commandLineArguments: '',
exclude: false
exclude: false,
excludeArtwork: false
})
}

Expand Down
14 changes: 13 additions & 1 deletion src/renderer/modifiers/user-exceptions.modifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let versionUp = (version: number) => { return version + 1 };

export const userExceptions: ValidatorModifier<UserExceptions> = {
controlProperty: 'exceptionsVersion',
latestVersion: 0,
latestVersion: 1,
fields: {
undefined: {
'exceptionsVersion': { method: () => 0 },
Expand All @@ -25,6 +25,18 @@ export const userExceptions: ValidatorModifier<UserExceptions> = {
}
})
}
},
0: {
'exceptionsVersion': { method: versionUp },
'titles': {
method: ((oldValue: any, oldExceptions: any) => {
let result = _.cloneDeep(oldValue);
for(let key in oldValue) {
result[key].excludeArtwork = false;
}
return result;
})
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/schemas/user-exceptions.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const userExceptions = {
newTitle: { type: 'string', default: '' },
searchTitle: { type: 'string', default: '' },
commandLineArguments: { type: 'string', default: ''},
exclude: { type: 'boolean', default: false }
exclude: { type: 'boolean', default: false },
excludeArtwork: { type: 'boolean', default: false }
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/styles/user-exceptions.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
.ngToggleButton {
font-size: 1em;

margin: 0.25em 0 0.5em 0;
margin: 0.25em 1em 0.5em 0;

@include ngToggleButtonColor(ng-toggle-button);
}
Expand All @@ -88,6 +88,9 @@

.ngSelect {
width: 15em;

@include ngSelectColor(ng-select);
@include ngSelect();
}
.ngTextInput {
&.middle {
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/templates/user-exceptions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<ng-text-input class="ngTextInput" placeholder="--custom-args" [formControl]="item.controls['commandLineArguments']"></ng-text-input>
</div>
<div class="inlineGroup">
<ng-toggle-button class="ngToggleButton" [formControl]="item.controls['exclude']">{{lang.text.exclude}}</ng-toggle-button>
<div class="inlineGroup">
<ng-toggle-button class="ngToggleButton excludeButton" [formControl]="item.controls['exclude']">{{lang.text.exclude}}</ng-toggle-button>
<ng-toggle-button class="ngToggleButton" [formControl]="item.controls['excludeArtwork']">{{lang.text.excludeArtwork}}</ng-toggle-button>
</div>
<div class="deleteItem" (click)="deleteItem(i)">{{lang.buttons.deleteItem}}</div>
</div>
</div>
Expand Down

0 comments on commit cd7c858

Please sign in to comment.