yaamp: upgrade to 0.0.4

This commit is contained in:
Raven 2024-02-27 15:54:20 +06:00
parent 82aa812048
commit b3dfe23750
3 changed files with 128 additions and 77 deletions

View File

@ -1,6 +1,7 @@
--- yaamp-0.0.1/package.json 2023-10-22 18:12:32.000000000 +0600
+++ yaamp-0.0.1/package.json.linux 2023-11-20 12:06:56.489617767 +0600
@@ -7,8 +7,8 @@
diff -Naur a/package.json b/package.json
--- a/package.json 2024-01-29 22:04:04.000000000 +0600
+++ b/package.json 2024-02-27 13:27:32.434079494 +0600
@@ -7,19 +7,19 @@
"main": false
},
"scripts": {
@ -11,16 +12,22 @@
"build": "yarn run copy && yarn build:src",
"build:src": "npx parcel build --public-url ./ ./src/index.html",
"watch": "npx parcel watch --public-url ./ --hmr-hostname 127.0.0.1 --hmr-port 54439 ./src/index.html",
@@ -23,7 +23,7 @@
"test": "jest",
"electron": "./node_modules/.bin/electron .",
"start": "yarn run build && electron .",
- "pack:win": "electron-builder build -w --x64",
- "pack:linux": "electron-builder build -l --x64",
- "pack:mac": "electron-builder build -m --x64",
+ "pack:win": "./node_modules/electron-builder/cli.js build -w --x64",
+ "pack:linux": "./node_modules/electron-builder/cli.js build -l --x64",
+ "pack:mac": "./node_modules/electron-builder/cli.js build -m --x64",
"pack": "yarn run pack:win && yarn run pack:linux && yarn run pack:mac",
- "dist": "yarn run build && build --x64"
+ "dist": "yarn run build && ./node_modules/electron-builder/cli.js build --x64"
},
"homepage": "https://yaamp.ru",
"repository": "https://github.com/umnik1/yaamp",
- "author": "Maksim Chingin",
+ "author": "Maksim Chingin <someone@example.com>",
"license": "MIT",
"dependencies": {
"axios": "^1.5.1",
@@ -84,8 +83,7 @@
@@ -84,8 +84,7 @@
},
"linux": {
"target": [

View File

@ -1,67 +1,102 @@
--- yaamp-0.0.1/main.js_ 2023-10-22 18:12:32.000000000 +0600
+++ yaamp-0.0.1/main.js 2023-11-20 13:29:34.191950115 +0600
@@ -292,35 +292,35 @@
})
diff -Naur a/main.js b/main.js
--- a/main.js 2024-01-29 22:04:04.000000000 +0600
+++ b/main.js 2024-02-27 11:16:45.506897863 +0600
@@ -3,7 +3,7 @@
const url = require('url')
const { ipcMain, webContents, session, remote } = require('electron')
const crypto = require("crypto");
-const DiscordRPC = require('discord-rpc');
+//const DiscordRPC = require('discord-rpc');
// Discord Integration
- await client.tracks.getTracks({"track-ids": [trackid]}).then((data) => {
- const element = data.result[0];
- const startTimestamp = new Date();
-
- let artist = [];
-
- element.artists.forEach((a) => {
- artist.push(a.name);
- });
-
- const presObj = {
- details: `${element.title}`,
- state: `${artist.join(', ')}`,
- largeImageKey: 'https://' + element.coverUri.replace("%%", "200x200"),
- largeImageText: `${artist.join(', ')} - ${element.title}`,
- smallImageKey: 'https://yaamp.ru/icon.png',
- smallImageText: 'Yaamp.ru',
- buttons: [
- {
- label: 'Listen this track',
- url: `https://music.yandex.ru/track/${element.id}`,
- },
- ],
- };
-
- rpc.setActivity(presObj);
-
- return data;
- })
+// await client.tracks.getTracks({"track-ids": [trackid]}).then((data) => {
+// const element = data.result[0];
+// const startTimestamp = new Date();
+//
+// let artist = [];
+//
+// element.artists.forEach((a) => {
+// artist.push(a.name);
+// });
+//
+// const presObj = {
+// details: `${element.title}`,
+// state: `${artist.join(', ')}`,
+// largeImageKey: 'https://' + element.coverUri.replace("%%", "200x200"),
+// largeImageText: `${artist.join(', ')} - ${element.title}`,
+// smallImageKey: 'https://yaamp.ru/icon.png',
+// smallImageText: 'Yaamp.ru',
+// buttons: [
+// {
+// label: 'Listen this track',
+// url: `https://music.yandex.ru/track/${element.id}`,
+// },
+// ],
+// };
+//
+// rpc.setActivity(presObj);
+//
+// return data;
+// })
const checkForUpdatesAndNotify = require('./src/node/updates.js')
const interceptStreamProtocol = require('./src/node/protocol.js')
@@ -39,11 +39,11 @@
const sessionId = crypto.randomBytes(20).toString('hex');
const clientId = '1161295534770892860';
return data;
-DiscordRPC.register(clientId);
+//DiscordRPC.register(clientId);
-const rpc = new DiscordRPC.Client({ transport: 'ipc' });
+//const rpc = new DiscordRPC.Client({ transport: 'ipc' });
-rpc.login({ clientId }).catch(console.error);
+//rpc.login({ clientId }).catch(console.error);
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
@@ -321,40 +321,40 @@
return data;
})
- // Discord Integration
-
- // Check on uploaded track
- if (!/^.*-.*-.*-.*-.*$/.test(trackid)) {
- await client.tracks.getTracks({"track-ids": [trackid]}).then((data) => {
- const element = data.result[0];
- const startTimestamp = new Date();
-
- let artist = [];
-
- element.artists.forEach((a) => {
- artist.push(a.name);
- });
-
- const presObj = {
- details: `${element.title}`,
- state: `${artist.join(', ')}`,
- largeImageKey: 'https://' + element.coverUri.replace("%%", "200x200"),
- largeImageText: `${artist.join(', ')} - ${element.title}`,
- smallImageKey: 'https://yaamp.ru/icon.png',
- smallImageText: 'Yaamp.ru',
- buttons: [
- {
- label: 'Listen this track',
- url: `https://music.yandex.ru/track/${element.id}`,
- },
- ],
- };
-
- rpc.setActivity(presObj);
-
- return data;
- })
- }
+// // Discord Integration
+//
+// // Check on uploaded track
+// if (!/^.*-.*-.*-.*-.*$/.test(trackid)) {
+// await client.tracks.getTracks({"track-ids": [trackid]}).then((data) => {
+// const element = data.result[0];
+// const startTimestamp = new Date();
+//
+// let artist = [];
+//
+// element.artists.forEach((a) => {
+// artist.push(a.name);
+// });
+//
+// const presObj = {
+// details: `${element.title}`,
+// state: `${artist.join(', ')}`,
+// largeImageKey: 'https://' + element.coverUri.replace("%%", "200x200"),
+// largeImageText: `${artist.join(', ')} - ${element.title}`,
+// smallImageKey: 'https://yaamp.ru/icon.png',
+// smallImageText: 'Yaamp.ru',
+// buttons: [
+// {
+// label: 'Listen this track',
+// url: `https://music.yandex.ru/track/${element.id}`,
+// },
+// ],
+// };
+//
+// rpc.setActivity(presObj);
+//
+// return data;
+// })
+// }
return data;
} else {

View File

@ -1,5 +1,5 @@
Name: yaamp
Version: 0.0.1
Version: 0.0.4
Release: 1%{dist}
License: MIT
Summary: Winamp-like audio player designed to be used with the Yandex.Music service
@ -14,7 +14,7 @@ Patch1: yaamp-build-fixes.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libstdc++-devel
BuildRequires: nodejs-devel >= 12.0
BuildRequires: nodejs-devel >= 1:12.0
BuildRequires: npm
BuildRequires: yarnpkg
BuildRequires: pkgconfig(x11)
@ -22,6 +22,9 @@ BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(xtst)
# Damn electron requirements
BuildRequires: nss nspr gtk3 atk at-spi2-atk libXcomposite libXdamage libXrandr
%description
%{summary}.
@ -30,13 +33,16 @@ BuildRequires: pkgconfig(xtst)
%build
npm config set update-notifier false
yarn cache clean
yarn global add node-gyp
yarn --link-duplicates --pure-lockfile
yarn dist --linux
yarn dist --linux --dir
%install
@ -55,5 +61,8 @@ install res/icon.png %{buildroot}/%{_datadir}/icons/hicolor/512x512/apps/yaamp.p
%{_datadir}/icons/hicolor/512x512/apps/%{name}.png
%changelog
* Tue Feb 27 2024 Raven <raven@sysadmins.ws> - 0.0.4-1
- update to 0.0.4
* Mon Nov 20 2023 Raven <raven@sysadmins.ws> - 0.0.1-1
- initial build