mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
scrobblerlog: use camelcase for constants
This commit is contained in:
parent
d51c97c648
commit
bcb1834994
3 changed files with 16 additions and 16 deletions
|
@ -45,16 +45,16 @@ import (
|
|||
type TZInfo string
|
||||
|
||||
const (
|
||||
TZ_UNKNOWN TZInfo = "UNKNOWN"
|
||||
TZ_UTC TZInfo = "UTC"
|
||||
TimezoneUnknown TZInfo = "UNKNOWN"
|
||||
TimezoneUTC TZInfo = "UTC"
|
||||
)
|
||||
|
||||
// L if listened at least 50% or S if skipped
|
||||
type Rating string
|
||||
|
||||
const (
|
||||
RATING_LISTENED Rating = "L"
|
||||
RATING_SKIPPED Rating = "S"
|
||||
RatingListened Rating = "L"
|
||||
RatingSkipped Rating = "S"
|
||||
)
|
||||
|
||||
// A single entry of a track in the scrobbler log file.
|
||||
|
@ -75,7 +75,7 @@ type ScrobblerLog struct {
|
|||
Client string
|
||||
Records []Record
|
||||
// Timezone to be used for timestamps in the log file,
|
||||
// if TZ is set to [TZ_UNKNOWN].
|
||||
// if TZ is set to [TimezoneUnknown].
|
||||
FallbackTimezone *time.Location
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ func (l *ScrobblerLog) Parse(data io.Reader, ignoreSkipped bool) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if ignoreSkipped && record.Rating == RATING_SKIPPED {
|
||||
if ignoreSkipped && record.Rating == RatingSkipped {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ func (l ScrobblerLog) rowToRecord(row []string) (Record, error) {
|
|||
}
|
||||
|
||||
var timezone *time.Location = nil
|
||||
if l.TZ == TZ_UNKNOWN {
|
||||
if l.TZ == TimezoneUnknown {
|
||||
timezone = l.FallbackTimezone
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue