diff --git a/src/service/mpris.ts b/src/service/mpris.ts index bf0d2eb..a71320e 100644 --- a/src/service/mpris.ts +++ b/src/service/mpris.ts @@ -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); diff --git a/src/service/notifications.ts b/src/service/notifications.ts index f7f54e0..c922d87 100644 --- a/src/service/notifications.ts +++ b/src/service/notifications.ts @@ -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],