-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #497 from gowon-bot/new-syncing
New Syncing
- Loading branch information
Showing
92 changed files
with
1,838 additions
and
1,822 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# NOTE: Ports should be specified in docker-compose.override.yml | ||
version: "3.9" | ||
services: | ||
gowon: | ||
build: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Flag } from "../../../lib/context/arguments/argumentTypes/Flag"; | ||
import { LilacBaseCommand } from "../../../lib/Lilac/LilacBaseCommand"; | ||
import { ConfirmationView } from "../../../lib/ui/views/ConfirmationView"; | ||
import { SyncingProgressView } from "../../../lib/ui/views/SyncingProgressView"; | ||
|
||
const args = { | ||
force: new Flag({ | ||
shortnames: ["f"], | ||
longnames: ["force"], | ||
description: "Stop your current sync and restart it", | ||
}), | ||
}; | ||
|
||
export default class Sync extends LilacBaseCommand<typeof args> { | ||
idSeed = "iz*one yujin"; | ||
subcategory = "library"; | ||
description = "Fully syncs your Last.fm data to Gowon"; | ||
aliases = ["fullindex", "index"]; | ||
|
||
arguments = args; | ||
|
||
slashCommand = true; | ||
|
||
async run() { | ||
this.lilacGuildsService.addUser( | ||
this.ctx, | ||
this.author.id, | ||
this.requiredGuild.id | ||
); | ||
|
||
const embed = this.minimalEmbed() | ||
.setDescription( | ||
"Syncing will download all your scrobbles from Last.fm. Are you sure you want to sync?" | ||
) | ||
.setFooter(this.syncHelp); | ||
|
||
const confirmationEmbed = new ConfirmationView(this.ctx, embed); | ||
|
||
if (!(await confirmationEmbed.awaitConfirmation(this.ctx))) { | ||
return; | ||
} | ||
|
||
await this.lilacUsersService.sync( | ||
this.ctx, | ||
{ discordID: this.author.id }, | ||
this.parsedArguments.force | ||
); | ||
|
||
const observable = this.lilacUsersService.syncProgress(this.ctx, { | ||
discordID: this.author.id, | ||
}); | ||
|
||
const syncProgressView = new SyncingProgressView( | ||
this.ctx, | ||
embed, | ||
observable | ||
); | ||
|
||
syncProgressView.subscribeToObservable(); | ||
} | ||
} |
Oops, something went wrong.