mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Fix checkboxes and bulk download
This commit is contained in:
@@ -14,16 +14,6 @@ export class StatusBarComponent {
|
||||
|
||||
@ViewChild('downloadsModal', { static: false }) downloadsModalComponent: ElementRef
|
||||
|
||||
multipleCompleted = false
|
||||
downloading = false
|
||||
error = false
|
||||
percent = 0
|
||||
// TODO
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
batchResults: any[]
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
chartGroups: any[][]
|
||||
|
||||
constructor(
|
||||
public downloadService: DownloadService,
|
||||
public searchService: SearchService,
|
||||
@@ -41,59 +31,10 @@ export class StatusBarComponent {
|
||||
}
|
||||
|
||||
async downloadSelected() {
|
||||
// this.chartGroups = []
|
||||
// // TODO
|
||||
// // this.batchResults = await window.electron.invoke.getBatchSongDetails(this.selectedResults.map(result => result.id))
|
||||
// const versionGroups = groupBy(this.batchResults, 'songID')
|
||||
// for (const versionGroup of versionGroups) {
|
||||
// if (versionGroup.findIndex(version => version.chartID !== versionGroup[0].chartID) !== -1) {
|
||||
// // Must have multiple charts of this song
|
||||
// this.chartGroups.push(versionGroup.filter(version => version.versionID === version.latestVersionID))
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (this.chartGroups.length === 0) {
|
||||
// for (const versions of versionGroups) {
|
||||
// // this.searchService.sortChart(versions)
|
||||
// const downloadVersion = versions[0]
|
||||
// const downloadSong = this.selectedResults.find(song => song.id === downloadVersion.songID)!
|
||||
// this.downloadService.addDownload(
|
||||
// downloadVersion.versionID, {
|
||||
// chartName: downloadVersion.chartName,
|
||||
// artist: downloadSong.artist,
|
||||
// charter: downloadVersion.charters,
|
||||
// driveData: downloadVersion.driveData,
|
||||
// })
|
||||
// }
|
||||
// } else {
|
||||
// // TODO
|
||||
// // $('#selectedModal').modal('show')
|
||||
// // [download all charts for each song] [deselect these songs] [X]
|
||||
// }
|
||||
}
|
||||
|
||||
downloadAllCharts() {
|
||||
// const songChartGroups = groupBy(this.batchResults, 'songID', 'chartID')
|
||||
// for (const chart of songChartGroups) {
|
||||
// // this.searchService.sortChart(chart)
|
||||
// const downloadVersion = chart[0]
|
||||
// const downloadSong = this.selectedResults.find(song => song.id === downloadVersion.songID)!
|
||||
// this.downloadService.addDownload(
|
||||
// downloadVersion.versionID, {
|
||||
// chartName: downloadVersion.chartName,
|
||||
// artist: downloadSong.artist,
|
||||
// charter: downloadVersion.charters,
|
||||
// driveData: downloadVersion.driveData,
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
}
|
||||
|
||||
deselectSongsWithMultipleCharts() {
|
||||
// TODO
|
||||
// for (const chartGroup of this.chartGroups) {
|
||||
// this.selectionService.deselectSong(chartGroup[0].songID)
|
||||
// }
|
||||
const selectedGroupIds = this.selectedGroupIds
|
||||
for (const chart of this.searchService.groupedSongs.filter(gs => selectedGroupIds.includes(gs[0].groupId))) {
|
||||
this.downloadService.addDownload(chart[0])
|
||||
}
|
||||
}
|
||||
|
||||
clearCompleted() {
|
||||
|
||||
Reference in New Issue
Block a user