mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-25 22:07:56 +02:00
Various output tweaks
This commit is contained in:
parent
e9b7aabc0a
commit
49d06b7f52
3 changed files with 9 additions and 9 deletions
|
@ -49,7 +49,7 @@ type ImportResult struct {
|
|||
|
||||
func resolveBackend(config *viper.Viper) (string, Backend, error) {
|
||||
backendName := config.GetString("backend")
|
||||
fmt.Printf("requested backend %s\n", backendName)
|
||||
// fmt.Printf("requested backend %s\n", backendName)
|
||||
backendType := knownBackends[backendName]
|
||||
if backendType == nil {
|
||||
return backendName, nil, errors.New(fmt.Sprintf("Unknown backend %s", backendName))
|
||||
|
|
|
@ -39,10 +39,10 @@ func (b DumpBackend) ImportListens(listens []Listen, oldestTimestamp time.Time)
|
|||
Count: len(listens),
|
||||
LastTimestamp: oldestTimestamp,
|
||||
}
|
||||
if result.Count > 0 {
|
||||
result.LastTimestamp = listens[len(listens)-1].ListenedAt
|
||||
}
|
||||
for _, listen := range listens {
|
||||
if listen.ListenedAt.Unix() > result.LastTimestamp.Unix() {
|
||||
result.LastTimestamp = listen.ListenedAt
|
||||
}
|
||||
fmt.Printf("Listen: \"%s\" by %s\n", listen.TrackName, listen.ArtistName())
|
||||
}
|
||||
return result, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue