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
SeeBeyond
Desktop Client
Commits
7f9463a6
Commit
7f9463a6
authored
Apr 23, 2020
by
SpinShare
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed DeleteOverlay
parent
0fbd4383
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
62 deletions
+65
-62
src/App.vue
src/App.vue
+3
-55
src/components/Overlays/DeleteOverlay.vue
src/components/Overlays/DeleteOverlay.vue
+4
-3
src/components/Song/SongLocalItem.vue
src/components/Song/SongLocalItem.vue
+1
-1
src/views/Library.vue
src/views/Library.vue
+57
-3
No files found.
src/App.vue
View file @
7f9463a6
...
...
@@ -2,13 +2,11 @@
<div
id=
"app"
>
<main>
<Navigation
/>
<router-view
/>
<router-view
ref=
"currentView"
/>
</main>
<ContextMenu>
</ContextMenu>
<DeleteOverlay
v-if=
"showDeleteOverlay"
v-bind:deleteFiles=
"deleteFiles"
/>
</div>
</
template
>
...
...
@@ -21,77 +19,27 @@
import
Navigation
from
'
@/components/Navigation/Navigation.vue
'
;
import
ContextMenu
from
'
@/components/ContextMenu/ContextMenu.vue
'
;
import
DeleteOverlay
from
'
@/components/Overlays/DeleteOverlay.vue
'
;
export
default
{
name
:
'
App
'
,
components
:
{
Navigation
,
ContextMenu
,
DeleteOverlay
ContextMenu
},
data
:
function
()
{
return
{
downloadQueue
:
[],
showDeleteOverlay
:
false
,
deleteFiles
:
[]
downloadQueue
:
[]
}
},
mounted
:
function
()
{
this
.
$root
.
$on
(
'
download
'
,
(
url
)
=>
{
this
.
addToQueue
(
url
);
});
this
.
$root
.
$on
(
'
delete
'
,
(
file
)
=>
{
this
.
$data
.
showDeleteOverlay
=
true
;
this
.
$data
.
deleteFiles
=
this
.
getConnectedFiles
(
file
);
console
.
log
(
this
.
$data
.
deleteFiles
);
});
this
.
$root
.
$on
(
'
deleteDeny
'
,
()
=>
{
this
.
$data
.
showDeleteOverlay
=
false
;
this
.
$data
.
deleteFiles
=
""
;
});
this
.
$root
.
$on
(
'
deleteConfirmed
'
,
()
=>
{
this
.
$data
.
deleteFiles
.
forEach
((
file
)
=>
{
fs
.
unlinkSync
(
file
);
});
this
.
$data
.
showDeleteOverlay
=
false
;
this
.
$data
.
deleteFiles
=
""
;
});
},
methods
:
{
addToQueue
:
function
(
url
)
{
this
.
$data
.
downloadQueue
.
push
(
url
);
console
.
log
(
"
Added
"
+
url
+
"
to queue
"
);
},
getConnectedFiles
:
function
(
srtbFilePath
)
{
let
userSettings
=
new
UserSettings
();
let
srtbContent
=
JSON
.
parse
(
fs
.
readFileSync
(
srtbFilePath
)
);
let
connectedFiles
=
[];
connectedFiles
.
push
(
srtbFilePath
);
let
stringValueContainers
=
srtbContent
[
'
largeStringValuesContainer
'
].
values
;
stringValueContainers
.
forEach
((
stringValueContainer
)
=>
{
if
(
stringValueContainer
.
key
==
"
SO_TrackInfo_TrackInfo
"
)
{
let
rawTrackInfo
=
JSON
.
parse
(
stringValueContainer
.
val
);
let
coverPath
=
glob
.
sync
(
path
.
join
(
userSettings
.
get
(
'
gameDirectory
'
),
"
AlbumArt
"
,
rawTrackInfo
.
albumArtReference
.
assetName
+
"
.*
"
))[
0
];
if
(
coverPath
)
{
connectedFiles
.
push
(
coverPath
);
}
}
if
(
stringValueContainer
.
key
.
includes
(
"
SO_ClipInfo
"
))
{
let
rawClipInfo
=
JSON
.
parse
(
stringValueContainer
.
val
);
let
clipPath
=
glob
.
sync
(
path
.
join
(
userSettings
.
get
(
'
gameDirectory
'
),
"
AudioClips
"
,
rawClipInfo
.
clipAssetReference
.
assetName
+
"
.*
"
))[
0
];
if
(
clipPath
)
{
connectedFiles
.
push
(
clipPath
);
}
}
});
return
connectedFiles
;
}
},
watch
:
{
...
...
src/components/Overlays/DeleteOverlay.vue
View file @
7f9463a6
...
...
@@ -9,7 +9,7 @@
</div>
</div>
<div
class=
"delete-actions"
>
<button
class=
"button"
>
Delete
</button>
<button
class=
"button"
v-on:click=
"confirm()"
>
Delete
</button>
<button
class=
"button"
v-on:click=
"close()"
>
Close
</button>
</div>
</div>
...
...
@@ -27,10 +27,11 @@
],
methods
:
{
confirm
()
{
this
.
$root
.
$emit
(
'
deleteConfirm
'
);
console
.
log
(
"
confirm
"
);
this
.
$parent
.
$emit
(
'
deleteConfirm
'
);
},
close
()
{
this
.
$
roo
t
.
$emit
(
'
deleteDeny
'
);
this
.
$
paren
t
.
$emit
(
'
deleteDeny
'
);
}
}
}
...
...
src/components/Song/SongLocalItem.vue
View file @
7f9463a6
...
...
@@ -38,7 +38,7 @@
x
:
e
.
pageX
,
y
:
e
.
pageY
,
items
:
[
{
icon
:
"
delete
"
,
title
:
"
Delete
"
,
method
:
()
=>
{
this
.
$
roo
t
.
$emit
(
'
delete
'
,
this
.
$props
.
file
);
}
}
{
icon
:
"
delete
"
,
title
:
"
Delete
"
,
method
:
()
=>
{
this
.
$
parent
.
$paren
t
.
$emit
(
'
delete
'
,
this
.
$props
.
file
);
}
}
]});
}
}
...
...
src/views/Library.vue
View file @
7f9463a6
...
...
@@ -14,17 +14,20 @@
v-bind=
"song"
/>
</
template
>
</SongRow>
<DeleteOverlay
v-if=
"showDeleteOverlay"
v-bind:deleteFiles=
"deleteFiles"
/>
</section>
</template>
<
script
>
import
glob
from
'
glob
'
;
import
fs
from
'
fs
'
;
import
glob
from
'
glob
'
;
import
path
from
'
path
'
;
import
UserSettings
from
'
@/modules/module.usersettings.js
'
;
import
SRXD
from
'
@/modules/module.srxd.js
'
;
import
DeleteOverlay
from
'
@/components/Overlays/DeleteOverlay.vue
'
;
import
SongRow
from
'
@/components/Song/SongRow.vue
'
;
import
SongLocalItem
from
'
@/components/Song/SongLocalItem.vue
'
;
import
SongInstallItem
from
'
@/components/Song/SongInstallItem.vue
'
;
...
...
@@ -33,16 +36,37 @@
name
:
'
Library
'
,
data
:
function
()
{
return
{
librarySongs
:
[]
librarySongs
:
[],
showDeleteOverlay
:
false
,
deleteFiles
:
[]
}
},
components
:
{
SongRow
,
SongLocalItem
,
SongInstallItem
SongInstallItem
,
DeleteOverlay
},
mounted
:
function
()
{
this
.
refreshLibrary
();
this
.
$on
(
'
delete
'
,
(
file
)
=>
{
this
.
$data
.
showDeleteOverlay
=
true
;
this
.
$data
.
deleteFiles
=
this
.
getConnectedFiles
(
file
);
console
.
log
(
this
.
$data
.
deleteFiles
);
});
this
.
$on
(
'
deleteDeny
'
,
()
=>
{
this
.
$data
.
showDeleteOverlay
=
false
;
this
.
$data
.
deleteFiles
=
""
;
});
this
.
$on
(
'
deleteConfirm
'
,
()
=>
{
this
.
$data
.
deleteFiles
.
forEach
((
file
)
=>
{
fs
.
unlinkSync
(
file
);
});
this
.
refreshLibrary
();
this
.
$data
.
showDeleteOverlay
=
false
;
this
.
$data
.
deleteFiles
=
""
;
});
},
methods
:
{
refreshLibrary
:
function
()
{
...
...
@@ -96,6 +120,36 @@
});
return
trackInfo
;
},
getConnectedFiles
:
function
(
srtbFilePath
)
{
let
userSettings
=
new
UserSettings
();
let
srtbContent
=
JSON
.
parse
(
fs
.
readFileSync
(
srtbFilePath
)
);
let
connectedFiles
=
[];
connectedFiles
.
push
(
srtbFilePath
);
let
stringValueContainers
=
srtbContent
[
'
largeStringValuesContainer
'
].
values
;
stringValueContainers
.
forEach
((
stringValueContainer
)
=>
{
if
(
stringValueContainer
.
key
==
"
SO_TrackInfo_TrackInfo
"
)
{
let
rawTrackInfo
=
JSON
.
parse
(
stringValueContainer
.
val
);
let
coverPath
=
glob
.
sync
(
path
.
join
(
userSettings
.
get
(
'
gameDirectory
'
),
"
AlbumArt
"
,
rawTrackInfo
.
albumArtReference
.
assetName
+
"
.*
"
))[
0
];
if
(
coverPath
)
{
connectedFiles
.
push
(
coverPath
);
}
}
if
(
stringValueContainer
.
key
.
includes
(
"
SO_ClipInfo
"
))
{
let
rawClipInfo
=
JSON
.
parse
(
stringValueContainer
.
val
);
let
clipPath
=
glob
.
sync
(
path
.
join
(
userSettings
.
get
(
'
gameDirectory
'
),
"
AudioClips
"
,
rawClipInfo
.
clipAssetReference
.
assetName
+
"
.*
"
))[
0
];
if
(
clipPath
)
{
connectedFiles
.
push
(
clipPath
);
}
}
});
return
connectedFiles
;
}
}
}
...
...
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