mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(macros): expose parsed dates from rls string (#334)
* feat(macros): expose parsed dates from rls string * feat(macros)!: add parsed year BREAKING CHANGE: add prefix Current to - year, month, day, hour, min, second
This commit is contained in:
parent
95ff83cd3a
commit
85fa941cd3
2 changed files with 32 additions and 15 deletions
|
@ -22,11 +22,12 @@ type Macro struct {
|
|||
Season int
|
||||
Episode int
|
||||
Year int
|
||||
Month int
|
||||
Day int
|
||||
Hour int
|
||||
Minute int
|
||||
Second int
|
||||
CurrentYear int
|
||||
CurrentMonth int
|
||||
CurrentDay int
|
||||
CurrentHour int
|
||||
CurrentMinute int
|
||||
CurrentSecond int
|
||||
}
|
||||
|
||||
func NewMacro(release domain.Release) Macro {
|
||||
|
@ -44,12 +45,13 @@ func NewMacro(release domain.Release) Macro {
|
|||
HDR: strings.Join(release.HDR, ", "),
|
||||
Season: release.Season,
|
||||
Episode: release.Episode,
|
||||
Year: currentTime.Year(),
|
||||
Month: int(currentTime.Month()),
|
||||
Day: currentTime.Day(),
|
||||
Hour: currentTime.Hour(),
|
||||
Minute: currentTime.Minute(),
|
||||
Second: currentTime.Second(),
|
||||
Year: release.Year,
|
||||
CurrentYear: currentTime.Year(),
|
||||
CurrentMonth: int(currentTime.Month()),
|
||||
CurrentDay: currentTime.Day(),
|
||||
CurrentHour: currentTime.Hour(),
|
||||
CurrentMinute: currentTime.Minute(),
|
||||
CurrentSecond: currentTime.Second(),
|
||||
}
|
||||
|
||||
return ma
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue