-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar.go
37 lines (35 loc) · 1011 Bytes
/
calendar.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"github.com/hashworks/xRELTerminalClient/src/xrel"
"os"
"strings"
)
func showUpcomingTitles(showReleases, showP2P bool) {
titles, err := xrel.GetUpcomingTitles()
ok(err, "Failed to get upcoming titles:\n")
titleCount := len(titles)
if titleCount == 0 {
fmt.Println("No upcoming titles found.")
os.Exit(1)
} else {
for i := 0; i < titleCount; i++ {
title := titles[i]
fmt.Println("[" + strings.ToUpper(title.Type) + "] " + title.Title + " [" + title.Genre + "]")
fmt.Println("\t" + title.LinkHref)
if showReleases {
if showP2P {
for i := 0; i < len(title.P2PReleases); i++ {
release := title.P2PReleases[i]
fmt.Println("\t" + release.GetPubTime().Format(xRELReleaseTimeFormat) + " - " + release.Dirname)
}
} else {
for i := 0; i < len(title.Releases); i++ {
release := title.Releases[i]
fmt.Println("\t" + release.GetTime().Format(xRELReleaseTimeFormat) + " - " + release.Dirname)
}
}
}
}
}
}