diff --git a/jobs/refresh-episodes/refresh-episodes.go b/jobs/refresh-episodes/refresh-episodes.go index 3a69ede5..081a1e76 100644 --- a/jobs/refresh-episodes/refresh-episodes.go +++ b/jobs/refresh-episodes/refresh-episodes.go @@ -36,14 +36,26 @@ func main() { } } - color.Cyan("High priority queue (%d):", len(highPriority)) - refreshQueue(highPriority) + switch queue { + case "high": + refreshQueue(highPriority) - color.Cyan("Medium priority queue (%d):", len(mediumPriority)) - refreshQueue(mediumPriority) + case "medium": + refreshQueue(mediumPriority) - color.Cyan("Low priority queue (%d):", len(lowPriority)) - refreshQueue(lowPriority) + case "low": + refreshQueue(lowPriority) + + default: + color.Cyan("High priority queue (%d):", len(highPriority)) + refreshQueue(highPriority) + + color.Cyan("Medium priority queue (%d):", len(mediumPriority)) + refreshQueue(mediumPriority) + + color.Cyan("Low priority queue (%d):", len(lowPriority)) + refreshQueue(lowPriority) + } color.Green("Finished.") } diff --git a/jobs/refresh-episodes/shell.go b/jobs/refresh-episodes/shell.go index a804ad45..2e2a1435 100644 --- a/jobs/refresh-episodes/shell.go +++ b/jobs/refresh-episodes/shell.go @@ -8,10 +8,12 @@ import ( // Shell parameters var animeID string +var queue string // Shell flags func init() { flag.StringVar(&animeID, "id", "", "ID of the anime you want to refresh") + flag.StringVar(&queue, "queue", "", "Queue type you want to refresh (high, medium, low)") flag.Parse() }