Skip to content

Commit

Permalink
Fixed #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ascensionist committed Jul 12, 2024
1 parent 63aa31d commit f97057b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "saturn",
"private": true,
"version": "1.0.0",
"version": "1.0.1",
"description": "",
"main": "background.js",
"scripts": {
Expand Down
14 changes: 10 additions & 4 deletions app/src/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class DeezerImage {
this.thumb = DeezerImage.url(this.hash, this.type, 256);
}
static url(hash, type, size = 256) {
if (type == "channel") { // a bit of a silly fix but i guess it works
let a = (Math.random() * 0xFFFFFF << 0).toString(16).padStart(6, '0');
// console.log(`https://singlecolorimage.com/get/${a}/500x150.png`)
return `https://singlecolorimage.com/get/${a}/500x150.png`;
}
if (!hash)
return `https://e-cdns-images.dzcdn.net/images/${type}/${size}x${size}-000000-80-0-0.jpg`;
return `https://e-cdns-images.dzcdn.net/images/${type}/${hash}/${size}x${size}-000000-80-0-0.jpg`;
Expand Down Expand Up @@ -189,13 +194,13 @@ class DeezerLibrary {
}
}

class SmartTrackList {
class SmartTrackList { // !
constructor(json) {
this.title = json.TITLE;
this.subtitle = json.SUBTITLE;
this.description = json.DESCRIPTION;
this.id = json.SMARTTRACKLIST_ID
this.cover = new DeezerImage(json.COVER.MD5, json.COVER.TYPE);
this.cover = new DeezerImage(json.PICTURES[0].MD5, json.PICTURES[0].TYPE);
}
}

Expand All @@ -209,7 +214,7 @@ class DeezerPage {
class DeezerChannel {
constructor(json, target) {
this.title = json.title;
this.image = new DeezerImage(json.pictures.md5, json.pictures.type);
this.image = new DeezerImage(json.pictures.md5, "channel"); // !
this.color = json.background_color;
this.id = json.id;
this.slug = json.slug; //Hopefully it's used for path
Expand Down Expand Up @@ -242,6 +247,7 @@ class ChannelSectionItem {
switch (this.type) {
case 'flow':
case 'smarttracklist':
console.log("smarttl: ", json.data) // Discover
this.data = new SmartTrackList(json.data);
break;
case 'playlist':
Expand All @@ -251,7 +257,7 @@ class ChannelSectionItem {
this.data = new Artist(json.data);
break;
case 'channel':
// console.log("a", json.data)
// console.log("channel: ", json.data) // Go beyond streaming:
this.data = new DeezerChannel(json.data, json.target);
break;
case 'album':
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "saturn",
"private": true,
"version": "1.0.0",
"version": "1.0.1",
"description": "Saturn PC",
"scripts": {
"pack": "electron-builder --dir",
Expand Down

0 comments on commit f97057b

Please sign in to comment.