mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-09-17 00:59:09 +02:00
added player status and worked on getting the integrations working with i3: 9714b2fa1d
This commit is contained in:
@@ -1,18 +1,33 @@
|
||||
const statuses = require("./../constants/statuses");
|
||||
|
||||
const mediaInfo = {
|
||||
title: "",
|
||||
artist: "",
|
||||
icon: "",
|
||||
status: statuses.paused,
|
||||
};
|
||||
const mediaInfoModule = {
|
||||
mediaInfo,
|
||||
};
|
||||
|
||||
/**
|
||||
* Update artist and song info in the mediaInfo constant
|
||||
*/
|
||||
mediaInfoModule.update = function(arg) {
|
||||
mediaInfo.title = propOrDefault(arg.title);
|
||||
mediaInfo.artist = propOrDefault(arg.message);
|
||||
mediaInfo.icon = propOrDefault(arg.icon);
|
||||
};
|
||||
|
||||
/**
|
||||
* Update tidal's status in the mediaInfo constant
|
||||
*/
|
||||
mediaInfoModule.updateStatus = function(status) {
|
||||
if (Object.values(statuses).includes(status)) {
|
||||
mediaInfo.status = status;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the property or a default value
|
||||
* @param {*} prop property to check
|
||||
|
Reference in New Issue
Block a user