ESM Conversion, fix downloads

This commit is contained in:
Geomitron
2024-07-09 19:50:44 -05:00
parent bfceb52f70
commit 26c6f5e6f5
25 changed files with 175 additions and 115 deletions

View File

@@ -1,6 +1,6 @@
import { EventEmitter, Injectable, NgZone } from '@angular/core'
import { assign } from 'lodash'
import _ from 'lodash'
import { ChartData } from 'src-shared/interfaces/search.interface'
import { removeStyleTags } from 'src-shared/UtilFunctions'
@@ -22,7 +22,7 @@ export class DownloadService {
} else if (downloadIndex === -1) {
this.downloads.push(download)
} else {
assign(this.downloads[downloadIndex], download)
_.assign(this.downloads[downloadIndex], download)
}
}))
}

View File

@@ -2,7 +2,7 @@ import { HttpClient } from '@angular/common/http'
import { EventEmitter, Injectable } from '@angular/core'
import { FormControl } from '@angular/forms'
import { chain, xorBy } from 'lodash'
import _ from 'lodash'
import { catchError, mergeMap, tap, throwError, timer } from 'rxjs'
import { Difficulty, Instrument } from 'scan-chart'
import { environment } from 'src-angular/environments/environment'
@@ -103,7 +103,7 @@ export class SearchService {
if (!nextPage) {
// Don't reload results if they are the same
if (this.groupedSongs
&& xorBy(this.songsResponse!.data, response.data, r => r.chartId).length === 0
&& _.xorBy(this.songsResponse!.data, response.data, r => r.chartId).length === 0
&& this.songsResponse!.found === response.found) {
return
} else {
@@ -113,7 +113,7 @@ export class SearchService {
this.songsResponse = response
this.groupedSongs.push(
...chain(response.data)
..._.chain(response.data)
.groupBy(c => c.songId ?? -1 * c.chartId)
.values()
.value()
@@ -148,7 +148,7 @@ export class SearchService {
// Don't reload results if they are the same
if (this.groupedSongs
&& xorBy(this.songsResponse!.data, response.data, r => r.chartId).length === 0
&& _.xorBy(this.songsResponse!.data, response.data, r => r.chartId).length === 0
&& this.songsResponse!.found === response.found) {
return
} else {
@@ -158,7 +158,7 @@ export class SearchService {
this.songsResponse = response
this.groupedSongs.push(
...chain(response.data)
..._.chain(response.data)
.groupBy(c => c.songId ?? -1 * c.chartId)
.values()
.value()