Commit 69fcd2b8 authored by Andreas Heimann's avatar Andreas Heimann

refactored srxd operations to a seperate module, added library

parent d4385397
...@@ -934,6 +934,11 @@ ...@@ -934,6 +934,11 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
"dev": true "dev": true
}, },
"uniqid": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/uniqid/-/uniqid-5.2.0.tgz",
"integrity": "sha512-LH8zsvwJ/GL6YtNfSOmMCrI9piraAUjBfw2MCvleNE6a4pVKJwXjG2+HWhkVeFcSg+nmaPKbMrMOoxwQluZ1Mg=="
},
"universalify": { "universalify": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"electron-dl": "^3.0.0", "electron-dl": "^3.0.0",
"ncp": "^2.0.0", "ncp": "^2.0.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"uniqid": "^5.2.0",
"unzipper": "^0.10.10" "unzipper": "^0.10.10"
} }
} }
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<link rel="stylesheet" href="assets/css/download.css" /> <link rel="stylesheet" href="assets/css/download.css" />
<link rel="stylesheet" href="assets/css/startup.css" /> <link rel="stylesheet" href="assets/css/startup.css" />
<link rel="stylesheet" href="assets/css/songdetail.css" /> <link rel="stylesheet" href="assets/css/songdetail.css" />
<link rel="stylesheet" href="assets/css/library.css" />
</head> </head>
<body> <body>
<main> <main>
...@@ -157,7 +158,25 @@ ...@@ -157,7 +158,25 @@
SEARCH SEARCH
</section> </section>
<section class="section-library"> <section class="section-library">
LIBRARY <div class="song-row song-row-library">
<div class="song-header">
<div class="row-title">INSTALLED SONGS</div>
<div class="row-controls">
<div class="item row-controls-reload" onclick="RefreshLibrary()"><i class="mdi mdi-refresh"></i></div>
</div>
</div>
<div class="song-list">
<div class="song-item song-item-add" onclick="InstallBackupManually()">
<div class="song-cover">
<div class="song-icon"><i class="mdi mdi-folder-music"></i></div>
</div>
<div class="song-metadata">
<div class="song-title">Install</div>
<div class="song-artist">Install a local .zip</div>
</div>
</div>
</div>
</div>
</section> </section>
<section class="section-settings"> <section class="section-settings">
SETTINGS<br /><br /> SETTINGS<br /><br />
...@@ -171,12 +190,9 @@ ...@@ -171,12 +190,9 @@
<div class="song-cover"></div> <div class="song-cover"></div>
<div class="song-meta-data"> <div class="song-meta-data">
<div class="song-title">Lorem Ipsum</div> <div class="song-title">Lorem Ipsum</div>
<div class="song-subtitle">Lorem Ipsum</div>
<div class="song-artist">Lorem Ipsum</div> <div class="song-artist">Lorem Ipsum</div>
<div class="song-tags"> <div class="song-tags">
<div class="tag">Test</div>
<div class="tag">Demo</div>
<div class="tag">Debug</div>
<div class="tag">API</div>
</div> </div>
<div class="song-charter"> <div class="song-charter">
<div class="song-charter-user"> <div class="song-charter-user">
...@@ -208,9 +224,10 @@ ...@@ -208,9 +224,10 @@
<!-- Scripts --> <!-- Scripts -->
<script src="./assets/js/init.js"></script> <script src="./assets/js/init.js"></script>
<script src="./assets/js/system.js"></script> <script src="./assets/js/userData.js"></script>
<script src="./assets/js/section.startup.js"></script> <script src="./assets/js/section.startup.js"></script>
<script src="./assets/js/section.songdetail.js"></script> <script src="./assets/js/section.songdetail.js"></script>
<script src="./assets/js/section.library.js"></script>
<script src="./assets/js/download.js"></script> <script src="./assets/js/download.js"></script>
<script src="./assets/js/navigation.js"></script> <script src="./assets/js/navigation.js"></script>
<!-- <script src="./assets/js/app.js"></script> --> <!-- <script src="./assets/js/app.js"></script> -->
......
.song-row-library .song-item .song-icon {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
display: flex;
justify-content: center;
align-items: center;
font-size: 32px;
}
.song-row-library {
& .song-item {
& .song-icon {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
display: flex;
justify-content: center;
align-items: center;
font-size: 32px;
}
}
}
\ No newline at end of file
...@@ -57,7 +57,7 @@ main aside .item:hover { ...@@ -57,7 +57,7 @@ main aside .item:hover {
} }
main aside .item.active { main aside .item.active {
opacity: 1; opacity: 1;
background: linear-gradient(135deg, #00FFEE, #45C1FF); background: linear-gradient(135deg, #00FFF0, #46BEFF);
} }
main aside .item .mdi { main aside .item .mdi {
font-size: 22px; font-size: 22px;
...@@ -122,3 +122,6 @@ section.section-startup.active { ...@@ -122,3 +122,6 @@ section.section-startup.active {
grid-template-rows: auto; grid-template-rows: auto;
grid-gap: 25px; grid-gap: 25px;
} }
section.section-library {
padding: 50px;
}
...@@ -55,7 +55,7 @@ main { ...@@ -55,7 +55,7 @@ main {
} }
&.active { &.active {
opacity: 1; opacity: 1;
background: linear-gradient(135deg, #00FFEE, #45C1FF); background: linear-gradient(135deg, #00FFF0, #46BEFF);
} }
& .mdi { & .mdi {
...@@ -125,4 +125,8 @@ section { ...@@ -125,4 +125,8 @@ section {
grid-gap: 25px; grid-gap: 25px;
} }
} }
&.section-library {
padding: 50px;
}
} }
\ No newline at end of file
...@@ -24,8 +24,12 @@ ...@@ -24,8 +24,12 @@
font-weight: bold; font-weight: bold;
font-size: 48px; font-size: 48px;
} }
.section-song-detail .song-detail-background .song-detail-dim .song-detail .song-meta-data .song-artist { .section-song-detail .song-detail-background .song-detail-dim .song-detail .song-meta-data .song-subtitle {
font-size: 20px; font-size: 20px;
}
.section-song-detail .song-detail-background .song-detail-dim .song-detail .song-meta-data .song-artist {
margin-top: 5px;
font-size: 18px;
opacity: 0.6; opacity: 0.6;
} }
.section-song-detail .song-detail-background .song-detail-dim .song-detail .song-meta-data .song-tags { .section-song-detail .song-detail-background .song-detail-dim .song-detail .song-meta-data .song-tags {
......
...@@ -26,8 +26,12 @@ ...@@ -26,8 +26,12 @@
font-weight: bold; font-weight: bold;
font-size: 48px; font-size: 48px;
} }
& .song-artist { & .song-subtitle {
font-size: 20px; font-size: 20px;
}
& .song-artist {
margin-top: 5px;
font-size: 18px;
opacity: 0.6; opacity: 0.6;
} }
& .song-tags { & .song-tags {
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
grid-gap: 25px; grid-gap: 25px;
} }
.staff-ads:empty {
display: none;
}
.staff-ads .staff-ad { .staff-ads .staff-ad {
background: #fff; background: #fff;
border-radius: 6px; border-radius: 6px;
...@@ -142,11 +145,17 @@ ...@@ -142,11 +145,17 @@
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
.song-row .song-list .song-item:not(.song-item-loading):hover { .song-row .song-list .song-item:not(.song-item-loading):not(.song-item-local):hover {
transform: scale(1.1); transform: scale(1.1);
cursor: pointer; cursor: pointer;
box-shadow: 0px 4px 20px 5px rgba(0, 0, 0, 0.4); box-shadow: 0px 4px 20px 5px rgba(0, 0, 0, 0.4);
} }
.song-row .song-list .song-item:not(.song-item-loading):hover .song-cover .song-charter { .song-row .song-list .song-item:not(.song-item-loading):not(.song-item-local):hover .song-cover .song-charter {
opacity: 1;
}
.song-row .song-list .song-item.song-item-local {
opacity: 0.6;
}
.song-row .song-list .song-item.song-item-local:hover .song-cover .song-charter {
opacity: 1; opacity: 1;
} }
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
grid-gap: 25px; grid-gap: 25px;
&:empty {
display: none;
}
& .staff-ad { & .staff-ad {
background: #fff; background: #fff;
border-radius: 6px; border-radius: 6px;
...@@ -156,7 +160,7 @@ ...@@ -156,7 +160,7 @@
} }
} }
&:not(.song-item-loading):hover { &:not(.song-item-loading):not(.song-item-local):hover {
transform: scale(1.1); transform: scale(1.1);
cursor: pointer; cursor: pointer;
box-shadow: 0px 4px 20px 5px rgba(0, 0, 0, 0.4); box-shadow: 0px 4px 20px 5px rgba(0, 0, 0, 0.4);
...@@ -167,6 +171,17 @@ ...@@ -167,6 +171,17 @@
} }
} }
} }
&.song-item-local {
opacity: 0.6;
&:hover {
& .song-cover {
& .song-charter {
opacity: 1;
}
}
}
}
} }
} }
} }
\ No newline at end of file
...@@ -22,22 +22,10 @@ function CloseDownloadOverlay() { ...@@ -22,22 +22,10 @@ function CloseDownloadOverlay() {
DOMDownloadOutput.innerText = "Downloading..."; DOMDownloadOutput.innerText = "Downloading...";
} }
function UnloadBackup() {
// Remove temp files
rimraf(currentBackupLocation, function() { console.log("Removed backup folder."); });
// Reset vars
currentBackupLocation = "";
currentSRTBLocation = "";
currentSongLocation = "";
currentSongTrackInfo = {};
}
ipcRenderer.on("download-complete", (event, downloadPath) => { ipcRenderer.on("download-complete", (event, downloadPath) => {
DOMDownloadOutput.innerText = "Extracing..."; DOMDownloadOutput.innerText = "Extracing...";
extractBackup(downloadPath, path.basename(downloadPath)).then(function(extractResult) { srxdControl.extractBackup(downloadPath, path.basename(downloadPath)).then(function(extractResult) {
DOMDownloadOutput.innerText = "Installing..."; DOMDownloadOutput.innerText = "Installing...";
if(extractResult) { if(extractResult) {
...@@ -48,56 +36,10 @@ ipcRenderer.on("download-complete", (event, downloadPath) => { ...@@ -48,56 +36,10 @@ ipcRenderer.on("download-complete", (event, downloadPath) => {
}); });
}); });
// TODO: Refactor these to dynamic returns
let currentBackupLocation = "";
let currentSRTBLocation = "";
let currentSongLocation = "";
let currentSongTrackInfo = {};
// Extract a local backup folder
async function extractBackup(filePath, fileName) {
if(currentBackupLocation != "") {
console.log("Unload previous Backup.");
UnloadBackup();
}
console.log("Extracting Backup.");
currentBackupLocation = path.join(tempDirLocation, "extract-" + fileName);
console.info(currentBackupLocation);
// Unzip to temp/CustomSpeens/Song
await fs.createReadStream(filePath).pipe(unzipper.Extract({ path: currentBackupLocation })).promise();
console.log("Loading Backup.");
// Find SRTB & OGG files
let srtbFilesInBackupLocation = getFilesFromPath(currentBackupLocation, ".srtb");
if(srtbFilesInBackupLocation.length < 1) {
console.error("No SRTB file found in backup.");
return false;
}
// Load SRTB file
currentSRTBLocation = path.join(currentBackupLocation, srtbFilesInBackupLocation[0]);
let srtbFile = JSON.parse( fs.readFileSync(currentSRTBLocation) );
currentSongTrackInfo = JSON.parse( srtbFile.largeStringValuesContainer.values[0].val );
// Load OGG file
let oggFilesInBackupLocation = getFilesFromPath(path.join(currentBackupLocation, "AudioClips"), ".ogg");
currentSongLocation = path.join(currentBackupLocation, oggFilesInBackupLocation[0]);
// TODO: Backup Validation
return currentBackupLocation;
}
// Install local backup folder // Install local backup folder
async function installBackup(backupLocation) { async function installBackup(backupLocation) {
// Copy temp folder to game dir // Copy temp folder to game dir
await ncp(backupLocation, gameDirLocation, function(error) { await ncp(backupLocation, userGameDirectory, function(error) {
if(error) { if(error) {
console.error(error); console.error(error);
console.error("Couldn't copy backup!"); console.error("Couldn't copy backup!");
...@@ -111,21 +53,4 @@ async function installBackup(backupLocation) { ...@@ -111,21 +53,4 @@ async function installBackup(backupLocation) {
DOMDownloadActions.classList.add("active"); DOMDownloadActions.classList.add("active");
DOMDownloadOutput.innerText = "Done!"; DOMDownloadOutput.innerText = "Done!";
}); });
}
// Used to find files by file extension
// by https://stackoverflow.com/a/52024318
function getFilesFromPath(path, extension) {
let dir = fs.readdirSync( path );
return dir.filter( elm => elm.match(new RegExp(`.*\.(${extension})$`, 'ig')));
}
function getSongCover(extension) {
let dir = fs.readdirSync( path.join(currentBackupLocation, "AlbumArt") );
let fileExtension = dir.filter( elm => elm.match(new RegExp(`(${extension}).*\.$`, 'ig')));
let finalPath = path.join(currentBackupLocation, "AlbumArt", fileExtension[0]);
let base64Data = "data:image/jpg;base64," + fs.readFileSync(finalPath, { encoding: 'base64' });
return base64Data;
} }
\ No newline at end of file
const { ipcRenderer } = require('electron'); const { ipcRenderer } = require('electron');
const { dialog, shell, app } = require('electron').remote; const { dialog, shell, app } = require('electron').remote;
const path = require('path'); const path = require('path');
const SHAPI = require( path.resolve(__dirname, './assets/js/api.js') ); const SSAPI = require( path.resolve(__dirname, './assets/js/module.api.js') );
const SRXD = require( path.resolve(__dirname, './assets/js/module.srxd.js') );
const fs = require('fs'); const fs = require('fs');
const rimraf = require('rimraf');
const ncp = require('ncp'); const ncp = require('ncp');
const http = require('http'); const http = require('http');
const unzipper = require('unzipper');
let api = new SHAPI(); let api = new SSAPI();
\ No newline at end of file let srxdControl = new SRXD();
\ No newline at end of file
const fs = require('fs');
const rimraf = require('rimraf');
const unzipper = require('unzipper');
const uniqid = require('uniqid');
class SRXD {
constructor() {
this.backupLocation = "";
this.srtbLocation = "";
this.songTrackInfo = {};
this.songLocation = "";
}
// Extract a local backup folder
async extractBackup(filePath, fileName) {
if(this.backupLocation != "") {
console.log("Unload previous Backup.");
this.unloadBackup();
}
console.log("Extracting Backup.");
this.backupLocation = path.join(tempDirLocation, "extract-" + uniqid());
console.info(this.backupLocation);
// Unzip to temp/CustomSpeens/Song
await fs.createReadStream(filePath).pipe(unzipper.Extract({ path: this.backupLocation })).promise();
console.log("Loading Backup.");
// Find SRTB & OGG files
let srtbFilesInBackupLocation = this.getFilesFromPath(this.backupLocation, ".srtb");
if(srtbFilesInBackupLocation.length < 1) {
console.error("No SRTB file found in backup.");
return false;
}
// Load SRTB file
this.srtbLocation = path.join(this.backupLocation, srtbFilesInBackupLocation[0]);
let srtbFile = JSON.parse( fs.readFileSync(this.srtbLocation) );
let songTrackInfo = "";
srtbFile.largeStringValuesContainer.values.forEach(function(value) {
if(value.key == "SO_TrackInfo_TrackInfo") {
songTrackInfo = value.val;
}
});
this.songTrackInfo = songTrackInfo;
// Load OGG file
let oggFilesInBackupLocation = this.getFilesFromPath(path.join(this.backupLocation, "AudioClips"), ".ogg");
this.songLocation = path.join(this.backupLocation, oggFilesInBackupLocation[0]);
// TODO: Backup Validation
return this.backupLocation;
}
async unloadBackup() {
// Remove temp files
console.log("Removing Backup Folder: " + this.backupLocation);
try {
rimraf(this.backupLocation, function() { console.log("Removed backup folder."); });
} catch(error) {
console.error(error);
}
// Reset vars
this.backupLocation = "";
this.srtbLocation = "";
this.songTrackInfo = {};
this.songLocation = "";
}
getSongDetail(srtbPath) {
let srtbFile = JSON.parse( fs.readFileSync(srtbPath) );
let songTrackInfo = "";
srtbFile.largeStringValuesContainer.values.forEach(function(value) {
if(value.key == "SO_TrackInfo_TrackInfo") {
songTrackInfo = JSON.parse( value.val );
}
});
return [songTrackInfo, this.getSongCover(songTrackInfo.albumArtReference.assetName)];
}
// Used to find files by file extension
// by https://stackoverflow.com/a/52024318
getFilesFromPath(path, extension) {
let dir = fs.readdirSync( path );
return dir.filter( elm => elm.match(new RegExp(`.*\.(${extension})$`, 'ig')));
}
getLocalSongs(path) {
let dir = fs.readdirSync( path );
return dir.filter( elm => elm.match(new RegExp(`.*\.srtb$`, 'ig')));
}
getSongCover(fileName) {
let dir = fs.readdirSync( path.join(userGameDirectory, "AlbumArt") );
let fileExtension = dir.filter( elm => elm.match(new RegExp(`(${fileName}).*\.$`, 'ig')));
let finalPath = path.join(userGameDirectory, "AlbumArt", fileExtension[0]);
let base64Data = "data:image/jpg;base64," + fs.readFileSync(finalPath, { encoding: 'base64' });
return base64Data;
}
getSongTrackInfo() {
return this.songTrackInfo;
}
}
module.exports = SRXD;
\ No newline at end of file
...@@ -26,6 +26,26 @@ function NavigateToSection(sectionIndex) { ...@@ -26,6 +26,26 @@ function NavigateToSection(sectionIndex) {
DOMSections[sectionIndex].classList.add("active"); DOMSections[sectionIndex].classList.add("active");
currentSection = sectionIndex; currentSection = sectionIndex;
switch(sectionIndex) {
case 0:
// Startup
InitStartup();
break;
case 1:
// Search
break;
case 2:
// Library
RefreshLibrary();
break;
case 3:
// Settings
break;
case 4:
// SongDetail
break;
}
} }
NavigateToSection(0); NavigateToSection(0);
......
const DOMLibrarySongsList = document.querySelector(".song-row-library .song-list");
function InstallBackupManually() {
dialog.showOpenDialog({ title: "Open Backup", properties: ['openFile'], filters: [{"name": "Backup Archive", "extensions": ["zip"]}] }).then(result => {
if(!result.canceled) {
let filePath = result.filePaths[0];
let fileName = path.basename(filePath);
srxdControl.extractBackup(filePath, fileName).then(function(extractResults) {
if(extractResults) {
installBackup(extractResults);
setTimeout(function() {
RefreshLibrary();
}, 200);
} else {
console.error("Backup could not be loaded!");
}
});
}
});
}
function RefreshLibrary() {
// Clear current songs
let installElement = DOMLibrarySongsList.firstElementChild;
DOMLibrarySongsList.innerHTML = "";
DOMLibrarySongsList.appendChild(installElement);
// Load all custom songs
let customSongs = srxdControl.getLocalSongs(userGameDirectory);
// remove current songs
customSongs.forEach(function(customSong) {
let songDetail = srxdControl.getSongDetail(path.join(userGameDirectory, customSong));
let spinShareReference = false;
if(customSong.includes("spinshare_")) {
spinShareReference = customSong.replace("spinshare_", "").replace(".srtb", "");
}
DOMLibrarySongsList.appendChild(BuildLibrarySongDOM(songDetail, spinShareReference));
})
}
function BuildLibrarySongDOM(songDetail, spinShareReference) {
let songContainer = document.createElement("div");
songContainer.classList.add("song-item");
if(!spinShareReference) {
songContainer.classList.add("song-item-local");
}
let songCover = document.createElement("div");
songCover.classList.add("song-cover");
songCover.style.backgroundImage = "url('" + songDetail[1] + "')";
let songCharterInfo = document.createElement("div");
songCharterInfo.classList.add("song-charter-info");
let songCharter = document.createElement("div");
songCharter.classList.add("song-charter");
songCharter.innerHTML = "<i class=\"mdi mdi-account-circle\"></i><span>" + songDetail[0].charter + "</span>";
songCharterInfo.appendChild(songCharter);
songCover.appendChild(songCharterInfo);
songContainer.appendChild(songCover);
let songMetaData = document.createElement("div");
songMetaData.classList.add("song-metadata");
let songTitle = document.createElement("div");
songTitle.classList.add("song-title");
songTitle.innerText = songDetail[0].title;
songMetaData.appendChild(songTitle);
let songArtist = document.createElement("div");
songArtist.classList.add("song-artist");
songArtist.innerText = songDetail[0].artistName;
songMetaData.appendChild(songArtist);
songContainer.appendChild(songMetaData);
if(spinShareReference) {
songContainer.addEventListener('click', function() {
NavigateToSongDetail(spinShareReference);
});
}
return songContainer;
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ let isPlayingPreview = false; ...@@ -8,6 +8,7 @@ let isPlayingPreview = false;
const DOMButtonPreview = DOMSongDetailActions.querySelector(".button-preview"); const DOMButtonPreview = DOMSongDetailActions.querySelector(".button-preview");
const DOMSongTitle = DOMSongDetail.querySelector(".song-title"); const DOMSongTitle = DOMSongDetail.querySelector(".song-title");
const DOMSongSubtitle = DOMSongDetail.querySelector(".song-subtitle");
const DOMSongArtist = DOMSongDetail.querySelector(".song-artist"); const DOMSongArtist = DOMSongDetail.querySelector(".song-artist");
const DOMSongCharter = DOMSongDetail.querySelector(".song-charter span"); const DOMSongCharter = DOMSongDetail.querySelector(".song-charter span");
const DOMSongTags = DOMSongDetail.querySelector(".song-tags"); const DOMSongTags = DOMSongDetail.querySelector(".song-tags");
...@@ -27,6 +28,7 @@ function SongDetailLoad(songId) { ...@@ -27,6 +28,7 @@ function SongDetailLoad(songId) {
DOMSongDetailCover.style.backgroundImage = "url('" + songData.paths.cover + "')"; DOMSongDetailCover.style.backgroundImage = "url('" + songData.paths.cover + "')";
DOMSongTitle.innerText = songData.title; DOMSongTitle.innerText = songData.title;
DOMSongSubtitle.innerText = songData.subtitle;
DOMSongArtist.innerText = songData.artist; DOMSongArtist.innerText = songData.artist;
DOMSongCharter.innerText = songData.charter; DOMSongCharter.innerText = songData.charter;
...@@ -57,7 +59,11 @@ function SongDetailTogglePreview() { ...@@ -57,7 +59,11 @@ function SongDetailTogglePreview() {
} }
function SongDetailStartPreview() { function SongDetailStartPreview() {
currentPreviewAudio = new Audio(currentSongData.paths.ogg); currentPreviewAudio = new Audio(currentSongData.paths.ogg);
currentPreviewAudio.volume = 0.4;
currentPreviewAudio.play(); currentPreviewAudio.play();
currentPreviewAudio.onended = function() {
SongDetailStopPreview();
}
isPlayingPreview = true; isPlayingPreview = true;
DOMButtonPreview.innerText = "PAUSE PREVIEW"; DOMButtonPreview.innerText = "PAUSE PREVIEW";
DOMButtonPreview.classList.add("button-primary"); DOMButtonPreview.classList.add("button-primary");
......
...@@ -13,6 +13,8 @@ let currentNewOffset = 0; ...@@ -13,6 +13,8 @@ let currentNewOffset = 0;
let currentPopularOffset = 0; let currentPopularOffset = 0;
function InitStartup() { function InitStartup() {
console.log("Refreshing Startup");
// Loading Ads // Loading Ads
api.getAds().then(function(ads) { api.getAds().then(function(ads) {
DOMStaffAds.innerHTML = ""; DOMStaffAds.innerHTML = "";
...@@ -29,8 +31,6 @@ function InitStartup() { ...@@ -29,8 +31,6 @@ function InitStartup() {
LoadPopularSongs(); LoadPopularSongs();
} }
InitStartup();
function NewSongsPrevious() { function NewSongsPrevious() {
if(currentNewOffset == 0) return; if(currentNewOffset == 0) return;
......
...@@ -2,12 +2,14 @@ console.log("Initializing System."); ...@@ -2,12 +2,14 @@ console.log("Initializing System.");
let systemOS = process.platform; let systemOS = process.platform;
let tempDirLocation = app.getPath('temp'); let tempDirLocation = app.getPath('temp');
let gameDirLocation;
let userShowExplicit = false;
let userGameDirectory = "";
// TODO: Mac/Linux Support // TODO: Mac/Linux Support
// TODO: Custom Dir // TODO: Custom Dir
if(process.platform == "win32") { if(process.platform == "win32") {
gameDirLocation = path.join(app.getPath("userData"), "../..", "LocalLow", "Super Spin Digital", "Spin Rhythm XD", "Custom"); userGameDirectory = path.join(app.getPath("userData"), "../..", "LocalLow", "Super Spin Digital", "Spin Rhythm XD", "Custom");
} else { } else {
console.error("Unsupported system"); console.error("Unsupported system");
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment