mirror of
https://github.com/WowUp/WowUp.git
synced 2026-04-23 23:37:11 -04:00
Select the latest file based on priority channels
This commit is contained in:
@@ -34,6 +34,8 @@ export class GetAddonListItem {
|
||||
}
|
||||
|
||||
public getLatestFile(channel: AddonChannelType): AddonSearchResultFile {
|
||||
return _.find(this.searchResult.files, (f) => f.channelType <= channel);
|
||||
let files = _.filter(this.searchResult.files, (f) => f.channelType <= channel);
|
||||
files = _.orderBy(files, ["releaseDate"]).reverse();
|
||||
return _.first(files);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user