Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Desktop Client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SpinShare
Desktop Client
Commits
cc3e18b9
Commit
cc3e18b9
authored
Apr 02, 2020
by
Andreas Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed identing, added user settings
parent
a4b3d7cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
src/assets/js/section.library.js
src/assets/js/section.library.js
+23
-24
No files found.
src/assets/js/section.library.js
View file @
cc3e18b9
const
DOMLibrarySongsList
=
document
.
querySelector
(
"
.song-row-library .song-list
"
);
const
DOMLibrarySongsList
=
document
.
querySelector
(
"
.song-row-library .song-list
"
);
//The Extraction Process
function
ExtractionProcess
(
filePath
)
{
function
ExtractionProcess
(
filePath
){
//Basic .zip detection so the console doesnt throw a flurry of errors complaining it can't unzip.
if
(
filePath
.
endsWith
(
'
.zip
'
)){
if
(
filePath
.
endsWith
(
'
.zip
'
)){
let
fileName
=
path
.
basename
(
filePath
)
let
fileName
=
path
.
basename
(
filePath
);
srxdControl
.
extractBackup
(
filePath
,
fileName
).
then
(
function
(
extractResults
)
{
srxdControl
.
extractBackup
(
filePath
,
fileName
).
then
(
function
(
extractResults
)
{
if
(
extractResults
)
{
if
(
extractResults
)
{
installBackup
(
extractResults
);
installBackup
(
extractResults
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
RefreshLibrary
();
RefreshLibrary
();
},
200
);
},
200
);
}
}
else
{
else
{
console
.
error
(
"
Backup could not be loaded!
"
);
console
.
error
(
"
Backup could not be loaded!
"
);
}
}
});
});
}
}
else
{
console
.
error
(
'
Not a zip!
'
);}
else
{
console
.
error
(
'
Not a zip!
'
);}
...
@@ -30,18 +27,20 @@ function InstallBackupManually() {
...
@@ -30,18 +27,20 @@ function InstallBackupManually() {
});
});
}
}
//Drag and Drop
//
Drag and Drop
document
.
ondragover
=
document
.
ondrop
=
(
dragndrop
)
=>
{
document
.
ondragover
=
document
.
ondrop
=
function
(
dragndrop
)
{
dragndrop
.
preventDefault
();
dragndrop
.
preventDefault
();
}
}
document
.
body
.
ondrop
=
(
ev
)
=>
{
document
.
body
.
ondrop
=
function
(
ev
)
{
let
filePath
=
(
ev
.
dataTransfer
.
files
[
0
].
path
)
let
filePath
=
(
ev
.
dataTransfer
.
files
[
0
].
path
)
;
ev
.
preventDefault
()
ev
.
preventDefault
()
;
ExtractionProcess
(
filePath
);
ExtractionProcess
(
filePath
);
}
}
function
RefreshLibrary
()
{
function
RefreshLibrary
()
{
console
.
log
(
"
Refreshing Library
"
);
// Clear current songs
// Clear current songs
let
installElement
=
DOMLibrarySongsList
.
firstElementChild
;
let
installElement
=
DOMLibrarySongsList
.
firstElementChild
;
...
@@ -49,15 +48,15 @@ function RefreshLibrary() {
...
@@ -49,15 +48,15 @@ function RefreshLibrary() {
DOMLibrarySongsList
.
appendChild
(
installElement
);
DOMLibrarySongsList
.
appendChild
(
installElement
);
// Load all custom songs
// Load all custom songs
let
customSongs
=
srxdControl
.
getLocalSongs
(
user
GameDirectory
);
let
customSongs
=
srxdControl
.
getLocalSongs
(
user
Settings
.
get
(
'
gameDirectory
'
)
);
// remove current songs
// remove current songs
customSongs
.
forEach
(
function
(
customSong
)
{
customSongs
.
forEach
(
function
(
customSong
)
{
let
songDetail
=
srxdControl
.
getSongDetail
(
path
.
join
(
user
GameDirectory
,
customSong
));
let
songDetail
=
srxdControl
.
getSongDetail
(
path
.
join
(
user
Settings
.
get
(
'
gameDirectory
'
)
,
customSong
));
let
spinShareReference
=
false
;
let
spinShareReference
=
false
;
if
(
customSong
.
includes
(
"
spinshare_
"
))
{
if
(
customSong
.
includes
(
"
spinshare_
"
))
{
spinShareReference
=
customSong
.
replace
(
"
spinshare_
"
,
""
).
replace
(
"
.srtb
"
,
""
);
spinShareReference
=
customSong
.
replace
(
"
.srtb
"
,
""
);
}
}
DOMLibrarySongsList
.
appendChild
(
BuildLibrarySongDOM
(
songDetail
,
spinShareReference
));
DOMLibrarySongsList
.
appendChild
(
BuildLibrarySongDOM
(
songDetail
,
spinShareReference
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment