Skip to content

Commit ced7c5c

Browse files
authored
AlbumArt3.0 v2.4.1: Ready for Linux Mint 23 (#1851)
1 parent 20dfb8a commit ced7c5c

5 files changed

Lines changed: 31 additions & 50 deletions

File tree

AlbumArt3.0@claudiux/files/AlbumArt3.0@claudiux/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v2.4.1~20260610
2+
* Ready for Linux Mint 23.
3+
14
### v2.4.0~20251122
25
* Correctly resizes the album cover.
36
* Fixes [#1674](https://github.com/linuxmint/cinnamon-spices-desklets/issues/1674)

AlbumArt3.0@claudiux/files/AlbumArt3.0@claudiux/desklet.js

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ const Tweener = imports.ui.tweener;
1111
const Util = imports.misc.util;
1212
const Settings = imports.ui.settings;
1313
const Gettext = imports.gettext;
14+
const Extension = imports.ui.extension;
15+
function _require(relPath) {
16+
if (Extension.getCurrentExtension) {
17+
var Me = Extension.getCurrentExtension();
18+
return Me.imports[relPath];
19+
} else {
20+
return require(relPath);
21+
}
22+
}
23+
1424
//Mainloop:
1525
const { timeout_add_seconds,
1626
timeout_add,
@@ -21,8 +31,8 @@ const { timeout_add_seconds,
2131
source_exists,
2232
source_remove,
2333
remove_all_sources
24-
} = require("./lib/mainloopTools");
25-
const { to_string } = require("./lib/to-string");
34+
} = _require("./lib/mainloopTools");
35+
const { to_string } = _require("./lib/to-string");
2636

2737

2838
const UUID = "AlbumArt3.0@claudiux";
@@ -49,17 +59,18 @@ Gettext.bindtextdomain(UUID, HOME_DIR + "/.local/share/locale");
4959
Gettext.bindtextdomain("cinnamon", "/usr/share/locale");
5060
function _(str) {
5161
let customTrans = Gettext.dgettext(UUID, str);
52-
if (customTrans.length > 0 && customTrans !== str)
53-
return customTrans;
54-
customTrans = Gettext.dgettext("cinnamon", str);
55-
if (customTrans.length > 0 && customTrans !== str)
56-
return customTrans;
57-
return Gettext.gettext(str);
62+
return customTrans;
63+
//~ if (customTrans.length > 0 && customTrans !== str)
64+
//~ return customTrans;
65+
//~ customTrans = Gettext.dgettext("cinnamon", str);
66+
//~ if (customTrans.length > 0 && customTrans !== str)
67+
//~ return customTrans;
68+
//~ return Gettext.gettext(str);
5869
}
5970

6071

6172

62-
class AlbumArtRadio30 extends Desklet.Desklet {
73+
var AlbumArtRadio30 = class AlbumArtRadio30 extends Desklet.Desklet {
6374
constructor(metadata, desklet_id) {
6475
super(metadata, desklet_id);
6576

@@ -295,14 +306,14 @@ class AlbumArtRadio30 extends Desklet.Desklet {
295306

296307
if (!this.isLooping) return false;
297308
this._update();
298-
309+
299310
if (this.isLooping) {
300311
if (this.oldRealWidth != this.realWidth || this.oldRealHeight != this.realHeight) {
301312
this.oldRealWidth = this.realWidth;
302313
this.oldRealHeight = this.realHeight;
303314
this.on_setting_changed();
304315
}
305-
316+
306317
this.update_id = timeout_add_seconds(this.delay, () => { this._update_loop() });
307318
} else {
308319
return false;
@@ -432,7 +443,7 @@ class AlbumArtRadio30 extends Desklet.Desklet {
432443
} else {
433444
if (this._bin != null) this._bin.set_child(this.currentPicture);
434445
}
435-
446+
436447
this.updateInProgress = false;
437448
}
438449

AlbumArt3.0@claudiux/files/AlbumArt3.0@claudiux/lib/mainloopTools.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const GLib = imports.gi.GLib;
2+
const Extension = imports.ui.extension;
23

34
/**
45
* _sourceIds
@@ -165,7 +166,7 @@ function remove_all_sources() {
165166
}
166167
}
167168

168-
module.exports = {
169+
if (!Extension.getCurrentExtension) module.exports = {
169170
_sourceIds,
170171
timeout_add_seconds,
171172
timeout_add,
Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const ByteArray = imports.byteArray;
2+
const Extension = imports.ui.extension;
23

34
const to_string = function(data) {
45
if (ByteArray.hasOwnProperty("toString")) {
@@ -8,41 +9,6 @@ const to_string = function(data) {
89
}
910
}
1011

11-
//~ const to_string = function(data) {
12-
//~ return stringFromUTF8Array(data);
13-
//~ }
14-
15-
//~ const stringFromUTF8Array = function(data) {
16-
//~ const extraByteMap = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
17-
//~ var count = data.length;
18-
//~ var str = "";
19-
20-
//~ for (var index = 0;index < count;)
21-
//~ {
22-
//~ var ch = data[index++];
23-
//~ if (ch & 0x80)
24-
//~ {
25-
//~ var extra = extraByteMap[(ch >> 3) & 0x07];
26-
//~ if (!(ch & 0x40) || !extra || ((index + extra) > count))
27-
//~ return null;
28-
29-
//~ ch = ch & (0x3F >> extra);
30-
//~ for (;extra > 0;extra -= 1)
31-
//~ {
32-
//~ var chx = data[index++];
33-
//~ if ((chx & 0xC0) != 0x80)
34-
//~ return null;
35-
36-
//~ ch = (ch << 6) | (chx & 0x3F);
37-
//~ }
38-
//~ }
39-
40-
//~ str += String.fromCharCode(ch);
41-
//~ }
42-
43-
//~ return str;
44-
//~ }
45-
46-
module.exports = {
12+
if (!Extension.getCurrentExtension) module.exports = {
4713
to_string
4814
}

AlbumArt3.0@claudiux/files/AlbumArt3.0@claudiux/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"name": "Album Art for Radio3.0 and Enhanced Sound applets",
55
"description": "A digital photo frame desklet to display an album art, if available",
66
"prevent-decorations": true,
7-
"version": "2.4.0",
7+
"version": "2.4.1",
88
"author": "claudiux"
99
}

0 commit comments

Comments
 (0)