mirror of
https://github.com/zoriya/ags.git
synced 2026-06-06 11:53:23 +00:00
stricter name filter
This commit is contained in:
@@ -131,8 +131,8 @@ class MprisPlayer extends GObject.Object {
|
||||
|
||||
_cacheCoverArt() {
|
||||
this.coverPath = MEDIA_CACHE_PATH + '/' +
|
||||
`${this.trackArtists.join(', ')} - ${this.trackTitle}`
|
||||
.replace(/[\,\*\?\"\<\>\|\#\:\?\/\'\(\)]/g, '');
|
||||
`${this.trackArtists.join(', ')}${this.trackTitle}`
|
||||
.replace(/[^a-zA-Z0-9]/g, '');
|
||||
|
||||
if (this.coverPath.length > 255)
|
||||
this.coverPath = this.coverPath.substring(0, 255);
|
||||
|
||||
@@ -180,13 +180,6 @@ class NotificationsService extends Service {
|
||||
);
|
||||
}
|
||||
|
||||
_filterName(name: string) {
|
||||
return NOTIFICATIONS_CACHE_PATH +
|
||||
'/' +
|
||||
name.replace(/[\ \,\*\?\"\<\>\|\#\:\?\/\!\']/g, '') +
|
||||
'.png';
|
||||
}
|
||||
|
||||
_readFromFile() {
|
||||
const file = readFile(NOTIFICATIONS_CACHE_PATH + '/notifications.json');
|
||||
if (!file)
|
||||
@@ -212,7 +205,7 @@ class NotificationsService extends Service {
|
||||
return null;
|
||||
|
||||
ensureDirectory();
|
||||
const fileName = this._filterName(name);
|
||||
const fileName = name.replace(/[^a-zA-Z0-9]/g, '');
|
||||
const image = image_data.recursiveUnpack();
|
||||
const pixbuf = GdkPixbuf.Pixbuf.new_from_bytes(
|
||||
image[6],
|
||||
|
||||
Reference in New Issue
Block a user