mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(macros): add missing variables (#1541)
* Add all macros * feat(macros): add month day and others --------- Co-authored-by: MagiX <magix_debian@scheins.info> Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
4fceccd611
commit
5e88d08b35
1 changed files with 118 additions and 62 deletions
|
@ -16,86 +16,142 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Macro struct {
|
type Macro struct {
|
||||||
TorrentName string
|
Artists string
|
||||||
TorrentPathName string
|
Audio []string
|
||||||
TorrentHash string
|
AudioChannels string
|
||||||
TorrentID string
|
AudioFormat string
|
||||||
TorrentUrl string
|
Bitrate string
|
||||||
TorrentDataRawBytes []byte
|
Bonus []string
|
||||||
MagnetURI string
|
|
||||||
Group string
|
|
||||||
GroupID string
|
|
||||||
DownloadUrl string
|
|
||||||
InfoUrl string
|
|
||||||
Indexer string
|
|
||||||
IndexerName string
|
|
||||||
IndexerIdentifier string
|
|
||||||
IndexerIdentifierExternal string
|
|
||||||
Title string
|
|
||||||
Type string
|
|
||||||
Category string
|
|
||||||
Categories []string
|
Categories []string
|
||||||
Resolution string
|
Category string
|
||||||
Source string
|
Codec []string
|
||||||
HDR string
|
Container string
|
||||||
FilterID int
|
|
||||||
FilterName string
|
|
||||||
Size uint64
|
|
||||||
SizeString string
|
|
||||||
Season int
|
|
||||||
Episode int
|
|
||||||
Year int
|
|
||||||
CurrentYear int
|
|
||||||
CurrentMonth int
|
|
||||||
CurrentDay int
|
CurrentDay int
|
||||||
CurrentHour int
|
CurrentHour int
|
||||||
CurrentMinute int
|
CurrentMinute int
|
||||||
|
CurrentMonth int
|
||||||
CurrentSecond int
|
CurrentSecond int
|
||||||
|
CurrentYear int
|
||||||
|
DownloadUrl string
|
||||||
|
Episode int
|
||||||
|
FilterID int
|
||||||
|
FilterName string
|
||||||
|
Freeleech bool
|
||||||
|
FreeleechPercent int
|
||||||
|
Group string
|
||||||
|
GroupID string
|
||||||
|
HDR string
|
||||||
|
HasCue bool
|
||||||
|
HasLog bool
|
||||||
|
Implementation string
|
||||||
|
Indexer string
|
||||||
|
IndexerIdentifier string
|
||||||
|
IndexerIdentifierExternal string
|
||||||
|
IndexerName string
|
||||||
|
InfoUrl string
|
||||||
|
Language []string
|
||||||
|
Leechers int
|
||||||
|
LogScore int
|
||||||
|
MagnetURI string
|
||||||
|
Origin string
|
||||||
|
Other []string
|
||||||
|
PreTime string
|
||||||
|
Protocol string
|
||||||
|
Proper bool
|
||||||
|
Region string
|
||||||
|
Repack bool
|
||||||
|
Resolution string
|
||||||
|
Season int
|
||||||
|
Seeders int
|
||||||
|
Size uint64
|
||||||
|
SizeString string
|
||||||
|
Source string
|
||||||
Tags string
|
Tags string
|
||||||
Artists string
|
Title string
|
||||||
|
TorrentDataRawBytes []byte
|
||||||
|
TorrentHash string
|
||||||
|
TorrentID string
|
||||||
|
TorrentName string
|
||||||
|
TorrentPathName string
|
||||||
|
TorrentUrl string
|
||||||
|
TorrentTmpFile string
|
||||||
|
Type string
|
||||||
|
Uploader string
|
||||||
|
Website string
|
||||||
|
Year int
|
||||||
|
Month int
|
||||||
|
Day int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMacro(release Release) Macro {
|
func NewMacro(release Release) Macro {
|
||||||
currentTime := time.Now()
|
currentTime := time.Now()
|
||||||
|
|
||||||
ma := Macro{
|
ma := Macro{
|
||||||
TorrentName: release.TorrentName,
|
Artists: release.Artists,
|
||||||
TorrentUrl: release.DownloadURL,
|
Audio: release.Audio,
|
||||||
TorrentPathName: release.TorrentTmpFile,
|
AudioChannels: release.AudioChannels,
|
||||||
TorrentDataRawBytes: release.TorrentDataRawBytes,
|
AudioFormat: release.AudioFormat,
|
||||||
TorrentHash: release.TorrentHash,
|
Bitrate: release.Bitrate,
|
||||||
TorrentID: release.TorrentID,
|
Bonus: release.Bonus,
|
||||||
MagnetURI: release.MagnetURI,
|
|
||||||
Group: release.Group,
|
|
||||||
GroupID: release.GroupID,
|
|
||||||
InfoUrl: release.InfoURL,
|
|
||||||
DownloadUrl: release.DownloadURL,
|
|
||||||
Indexer: release.Indexer.Identifier,
|
|
||||||
IndexerName: release.Indexer.Name,
|
|
||||||
IndexerIdentifier: release.Indexer.Identifier,
|
|
||||||
IndexerIdentifierExternal: release.Indexer.IdentifierExternal,
|
|
||||||
Title: release.Title,
|
|
||||||
Type: release.Type,
|
|
||||||
Category: release.Category,
|
|
||||||
Categories: release.Categories,
|
Categories: release.Categories,
|
||||||
Resolution: release.Resolution,
|
Category: release.Category,
|
||||||
Source: release.Source,
|
Codec: release.Codec,
|
||||||
HDR: strings.Join(release.HDR, ", "),
|
Container: release.Container,
|
||||||
FilterID: release.FilterID,
|
|
||||||
FilterName: release.FilterName,
|
|
||||||
Size: release.Size,
|
|
||||||
SizeString: humanize.Bytes(release.Size),
|
|
||||||
Season: release.Season,
|
|
||||||
Episode: release.Episode,
|
|
||||||
Year: release.Year,
|
|
||||||
CurrentYear: currentTime.Year(),
|
|
||||||
CurrentMonth: int(currentTime.Month()),
|
|
||||||
CurrentDay: currentTime.Day(),
|
CurrentDay: currentTime.Day(),
|
||||||
CurrentHour: currentTime.Hour(),
|
CurrentHour: currentTime.Hour(),
|
||||||
CurrentMinute: currentTime.Minute(),
|
CurrentMinute: currentTime.Minute(),
|
||||||
|
CurrentMonth: int(currentTime.Month()),
|
||||||
CurrentSecond: currentTime.Second(),
|
CurrentSecond: currentTime.Second(),
|
||||||
|
CurrentYear: currentTime.Year(),
|
||||||
|
DownloadUrl: release.DownloadURL,
|
||||||
|
Episode: release.Episode,
|
||||||
|
FilterID: release.FilterID,
|
||||||
|
FilterName: release.FilterName,
|
||||||
|
Freeleech: release.Freeleech,
|
||||||
|
FreeleechPercent: release.FreeleechPercent,
|
||||||
|
Group: release.Group,
|
||||||
|
GroupID: release.GroupID,
|
||||||
|
HDR: strings.Join(release.HDR, ", "),
|
||||||
|
HasCue: release.HasCue,
|
||||||
|
HasLog: release.HasLog,
|
||||||
|
Implementation: release.Implementation.String(),
|
||||||
|
Indexer: release.Indexer.Identifier,
|
||||||
|
IndexerIdentifier: release.Indexer.Identifier,
|
||||||
|
IndexerIdentifierExternal: release.Indexer.IdentifierExternal,
|
||||||
|
IndexerName: release.Indexer.Name,
|
||||||
|
InfoUrl: release.InfoURL,
|
||||||
|
Language: release.Language,
|
||||||
|
Leechers: release.Leechers,
|
||||||
|
LogScore: release.LogScore,
|
||||||
|
MagnetURI: release.MagnetURI,
|
||||||
|
Origin: release.Origin,
|
||||||
|
Other: release.Other,
|
||||||
|
PreTime: release.PreTime,
|
||||||
|
Protocol: release.Protocol.String(),
|
||||||
|
Proper: release.Proper,
|
||||||
|
Region: release.Region,
|
||||||
|
Repack: release.Repack,
|
||||||
|
Resolution: release.Resolution,
|
||||||
|
Season: release.Season,
|
||||||
|
Seeders: release.Seeders,
|
||||||
|
Size: release.Size,
|
||||||
|
SizeString: humanize.Bytes(release.Size),
|
||||||
|
Source: release.Source,
|
||||||
Tags: strings.Join(release.Tags, ", "),
|
Tags: strings.Join(release.Tags, ", "),
|
||||||
Artists: release.Artists,
|
Title: release.Title,
|
||||||
|
TorrentDataRawBytes: release.TorrentDataRawBytes,
|
||||||
|
TorrentHash: release.TorrentHash,
|
||||||
|
TorrentID: release.TorrentID,
|
||||||
|
TorrentName: release.TorrentName,
|
||||||
|
TorrentPathName: release.TorrentTmpFile,
|
||||||
|
TorrentUrl: release.DownloadURL,
|
||||||
|
TorrentTmpFile: release.TorrentTmpFile,
|
||||||
|
Type: release.Type,
|
||||||
|
Uploader: release.Uploader,
|
||||||
|
Website: release.Website,
|
||||||
|
Year: release.Year,
|
||||||
|
Month: release.Month,
|
||||||
|
Day: release.Day,
|
||||||
}
|
}
|
||||||
|
|
||||||
return ma
|
return ma
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue