STR v2.0.3
This commit is contained in:
parent
9bcfcfb2ee
commit
a4ef267b4d
|
@ -1,4 +1,7 @@
|
|||
# [SaveToRedux](https://1lighty.github.io/BetterDiscordStuff/?plugin=SaveToRedux "SaveToRedux") Changelog
|
||||
### 2.0.3
|
||||
- Saving pictures from steam now works properly
|
||||
|
||||
### 2.0.2
|
||||
- Plugin has been renamed to SaveToRedux to avoid issues loading due to the original plugin, as well as to be able to distinguish between the two more easily.
|
||||
- Changed update URL
|
||||
|
|
|
@ -41,16 +41,16 @@ var SaveToRedux = (() => {
|
|||
twitter_username: ''
|
||||
}
|
||||
],
|
||||
version: '2.0.2',
|
||||
version: '2.0.3',
|
||||
description: 'Allows you to save images, videos, profile icons, server icons, reactions, emotes and custom status emotes to any folder quickly.',
|
||||
github: 'https://github.com/1Lighty',
|
||||
github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/SaveToRedux/SaveToRedux.plugin.js'
|
||||
},
|
||||
changelog: [
|
||||
{
|
||||
title: 'plugin rename',
|
||||
type: 'added',
|
||||
items: ['Plugin has been renamed to SaveToRedux to avoid issues loading due to the original plugin, as well as to be able to distinguish between the two more easily.', 'Changed update URL']
|
||||
title: 'Fixed',
|
||||
type: 'fixed',
|
||||
items: ['Saving pictures from steam now works properly']
|
||||
}
|
||||
],
|
||||
defaultConfig: [
|
||||
|
@ -357,6 +357,7 @@ var SaveToRedux = (() => {
|
|||
}
|
||||
|
||||
formatURL(url, requiresSize, customName) {
|
||||
if (url.indexOf('//steamuserimages') !== -1) url = url.replace(/\/$/, '');
|
||||
if (url.indexOf('/a_') !== -1) url = url.replace('.webp', '.gif').replace('.png', '.gif');
|
||||
else url = url.replace('.webp', '.png');
|
||||
let fileName = url.substr(url.lastIndexOf('/') + 1);
|
||||
|
@ -368,8 +369,14 @@ var SaveToRedux = (() => {
|
|||
extension = name;
|
||||
name = url.match(/\/\/media.tenor.co\/[^\/]+\/([^\/]+)\//)[1];
|
||||
} else if (url.indexOf('//i.giphy.com/media/') !== -1) name = url.match(/\/\/i\.giphy\.com\/media\/([^\/]+)\//)[1];
|
||||
else if (url.indexOf('//steamuserimages') !== -1) {
|
||||
extension = 'png';
|
||||
url += '/'; /* ??? */
|
||||
}
|
||||
name = this.formatFilename(name);
|
||||
return { fileName: (extension && `${name}.${extension}`) || name, url: url, name, extension };
|
||||
const ret = { fileName: (extension && `${name}.${extension}`) || name, url: url, name, extension };
|
||||
// Logger.info(`[formatURL] url \`${url}\` requiresSize \`${requiresSize}\` customName \`${customName}\`, ret ${JSON.stringify(ret, '', 1)}`);
|
||||
return ret;
|
||||
}
|
||||
|
||||
constructMenu(url, type, customName) {
|
||||
|
@ -684,10 +691,10 @@ var SaveToRedux = (() => {
|
|||
}
|
||||
url = src;
|
||||
if (!url) return;
|
||||
if (/\.(png|jpe?g|webp|gif|svg)$/i.test(url)) saveType = 'Image';
|
||||
if (/\.(mp4|webm|mov)$/i.test(url)) saveType = 'Video';
|
||||
if (/\.(mp3|ogg|wav|flac)$/i.test(url)) saveType = 'Audio';
|
||||
if (url.indexOf('app.com/emojis/') !== -1) {
|
||||
if (/\.(png|jpe?g|webp|gif|svg)$/i.test(url) || url.indexOf('//steamuserimages') !== -1) saveType = 'Image';
|
||||
else if (/\.(mp4|webm|mov)$/i.test(url)) saveType = 'Video';
|
||||
else if (/\.(mp3|ogg|wav|flac)$/i.test(url)) saveType = 'Audio';
|
||||
else if (url.indexOf('app.com/emojis/') !== -1) {
|
||||
saveType = 'Emoji';
|
||||
const emojiId = url.split('emojis/')[1].split('.')[0];
|
||||
const emoji = EmojiUtils.getDisambiguatedEmojiContext().getById(emojiId);
|
||||
|
|
Loading…
Reference in New Issue