scrobblerlog: use camelcase for constants

This commit is contained in:
Philipp Wolfer 2025-04-29 13:29:00 +02:00
parent d51c97c648
commit bcb1834994
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
3 changed files with 16 additions and 16 deletions

View file

@ -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
}