fix video alignment default settings
This commit is contained in:
parent
977d103c3a
commit
085bd4aab9
@ -253,6 +253,17 @@ const ExtensionConfPatch = [
|
||||
},
|
||||
})
|
||||
}
|
||||
}, {
|
||||
forVersion: '5.99.5',
|
||||
updateFn: (userOptions: SettingsInterface, defaultOptions) => {
|
||||
if (!userOptions.sites['@global'].defaults.alignment || !userOptions.sites['@global'].defaults.alignment.x || !userOptions.sites['@global'].defaults.alignment.y) {
|
||||
userOptions.sites['@global'].defaults.alignment = {
|
||||
x: VideoAlignmentType.Center,
|
||||
y: VideoAlignmentType.Center
|
||||
};
|
||||
}
|
||||
userOptions.sites['@empty'].defaults.alignment = {x: VideoAlignmentType.Default, y: VideoAlignmentType.Default};
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -1447,8 +1447,8 @@ const ExtensionConf: SettingsInterface = {
|
||||
defaults: {
|
||||
crop: {type: AspectRatioType.Reset}, // does NOT override Aard
|
||||
stretch: StretchType.NoStretch,
|
||||
alignment: {x: VideoAlignmentType.Center, y: VideoAlignmentType.Center},
|
||||
}
|
||||
|
||||
},
|
||||
"@empty": { // placeholder settings object with fallbacks to @global
|
||||
enable: {
|
||||
@ -1471,6 +1471,7 @@ const ExtensionConf: SettingsInterface = {
|
||||
defaults: {
|
||||
crop: null,
|
||||
stretch: StretchType.Default,
|
||||
alignment: {x: VideoAlignmentType.Default, y: VideoAlignmentType.Default},
|
||||
}
|
||||
},
|
||||
"www.youtube.com" : {
|
||||
|
@ -66,16 +66,16 @@ export class SiteSettings {
|
||||
|
||||
// these can contain default options, but can also be undefined
|
||||
if (this.data.defaults?.stretch === StretchType.Default || this.data.defaults?.stretch === undefined) {
|
||||
this.data.defaults.stretch = _cp(this.defaultSettings.defaults.stretch);
|
||||
this.data.defaults.stretch = _cp(this.defaultSettings.defaults.stretch ?? StretchType.NoStretch);
|
||||
}
|
||||
if (this.data.defaults?.alignment === undefined) { // distinguish between undefined and 0!
|
||||
this.data.defaults.alignment = _cp(this.defaultSettings.defaults.alignment);
|
||||
this.data.defaults.alignment = _cp(this.defaultSettings.defaults.alignment ?? {x: VideoAlignmentType.Center, y: VideoAlignmentType.Center});
|
||||
} else {
|
||||
if (this.data.defaults?.alignment.x === VideoAlignmentType.Default) {
|
||||
this.data.defaults.alignment.x = _cp(this.defaultSettings.defaults.alignment.x);
|
||||
this.data.defaults.alignment.x = _cp(this.defaultSettings.defaults.alignment.x ?? VideoAlignmentType.Center);
|
||||
}
|
||||
if (this.data.defaults.alignment.y === VideoAlignmentType.Default) {
|
||||
this.data.defaults.alignment.y = _cp(this.defaultSettings.defaults.alignment.y);
|
||||
this.data.defaults.alignment.y = _cp(this.defaultSettings.defaults.alignment.y ?? VideoAlignmentType.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"manifest_version": 2,
|
||||
"name": "Ultrawidify",
|
||||
"description": "Removes black bars on ultrawide videos and offers advanced options to fix aspect ratio.",
|
||||
"version": "5.99.0-4",
|
||||
"version": "5.99.5",
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "{cf02b1a7-a01a-4e37-a609-516a283f1ed3}"
|
||||
|
Loading…
Reference in New Issue
Block a user