Documentation ¶
Index ¶
- Constants
- Variables
- func ArchiveUserFiles() error
- func CheckLog(t *tracker.Gazelle, logPaths []string) error
- func ColorizeDownloadState(value int, txt string) string
- func DirectoryContainsMusicAndMetadata(directoryPath string) bool
- func DownloadState(txt string) int
- func FuseMount(path, mountpoint, dbPath string) error
- func GenerateStats(e *Environment) error
- func GetPassphrase() (string, error)
- func GoGoRoutines(e *Environment, noDaemon bool)
- func HasSuffix(field, v string) q.Matcher
- func InSlice(field, v string) q.Matcher
- func IsValidDownloadState(txt string) bool
- func MatchAllInSlice(a []string, b []string) bool
- func MatchInSlice(a string, b []string) bool
- func Notify(msg, tracker, msgType string, e *Environment) error
- func RefreshLibraryMetadata(path string, t *tracker.Gazelle, id string) error
- func RefreshMetadata(e *Environment, t *tracker.Gazelle, IDStrings []string) error
- func ReorganizeLibrary(doNothing, interactive bool) error
- func Reseed(t *tracker.Gazelle, path []string) error
- func SavePassphraseForDaemon() ([]byte, error)
- func SendOrders(command []byte) error
- func ShowTorrentInfo(e *Environment, t *tracker.Gazelle, IDStrings []string) error
- func SnatchTorrents(e *Environment, t *tracker.Gazelle, IDStrings []string, useFLToken bool) error
- func TimeTrack(start time.Time, name string)
- type Config
- func (c *Config) DecryptTo(file string, passphrase []byte) error
- func (c *Config) Encrypt(file string, passphrase []byte) error
- func (c *Config) GetAutosnatch(label string) (*ConfigAutosnatch, error)
- func (c *Config) GetStats(label string) (*ConfigStats, error)
- func (c *Config) GetTracker(label string) (*ConfigTracker, error)
- func (c *Config) Load(file string) error
- func (c *Config) LoadFromBytes(b []byte) error
- func (c *Config) String() string
- func (c *Config) TrackerLabels() []string
- type ConfigAutosnatch
- type ConfigFilter
- type ConfigGeneral
- type ConfigGitlabPages
- type ConfigIRC
- type ConfigLibrary
- type ConfigMPD
- type ConfigMetadata
- type ConfigNotifications
- type ConfigPushover
- type ConfigStats
- type ConfigTracker
- type ConfigWebServer
- type Database
- type DownloadEntry
- func (d *DownloadEntry) Description(root string) string
- func (d *DownloadEntry) Load(root string) error
- func (d *DownloadEntry) RawShortString() string
- func (d *DownloadEntry) ShortState() string
- func (d *DownloadEntry) ShortString() string
- func (d *DownloadEntry) Sort(e *Environment, root string) error
- func (d *DownloadEntry) String() string
- type DownloadsDB
- func (d *DownloadsDB) Clean() error
- func (d *DownloadsDB) Close() error
- func (d *DownloadsDB) FindByArtist(artist string) []DownloadEntry
- func (d *DownloadsDB) FindByFolderName(folderName string) (DownloadEntry, error)
- func (d *DownloadsDB) FindByID(id int) (DownloadEntry, error)
- func (d *DownloadsDB) FindByState(state string) []DownloadEntry
- func (d *DownloadsDB) RescanIDs(IDs []int) error
- func (d *DownloadsDB) RescanPath(folderName string) error
- func (d *DownloadsDB) Scan() error
- func (d *DownloadsDB) Sort(e *Environment) error
- func (d *DownloadsDB) SortThisID(e *Environment, id int, ignoreSorted bool) error
- func (d *DownloadsDB) String() string
- type Environment
- func (e *Environment) DeployToGitlabPages() error
- func (e *Environment) GenerateIndex() error
- func (e *Environment) LoadConfiguration() error
- func (e *Environment) SetConfig(c *Config)
- func (e *Environment) SetUp(autologin bool) error
- func (e *Environment) Tracker(label string) (*tracker.Gazelle, error)
- type FS
- type FuseDB
- type FuseDir
- type FuseEntry
- type FuseFile
- type FuseFileHandle
- type FusePath
- type HTMLIndex
- func (hi *HTMLIndex) IndexDownloadsInfo() ([]byte, error)
- func (hi *HTMLIndex) IndexDownloadsList() ([]byte, error)
- func (hi *HTMLIndex) IndexStats() ([]byte, error)
- func (hi *HTMLIndex) MainPage() ([]byte, error)
- func (hi *HTMLIndex) SetMainContentDownloadsInfo() error
- func (hi *HTMLIndex) SetMainContentDownloadsList() error
- func (hi *HTMLIndex) SetMainContentStats() error
- type HTMLLink
- type HTMLStats
- type HistoryTheme
- type IncomingJSON
- type MPD
- func (m *MPD) Add(path string) error
- func (m *MPD) Clear() error
- func (m *MPD) Close() error
- func (m *MPD) Connect(c *ConfigMPD) error
- func (m *MPD) Disable(path string) error
- func (m *MPD) DisableAndDisconnect(dlFolder, release string) error
- func (m *MPD) Enable(path string) error
- func (m *MPD) IsRunning() bool
- func (m *MPD) Play() error
- func (m *MPD) SendAndPlay(dlFolder, release string) error
- func (m *MPD) Stop() error
- func (m *MPD) Update() error
- type Notification
- type OriginJSON
- type OutgoingJSON
- type Release
- func (r *Release) HasCompatibleTrackerInfo(filter *ConfigFilter, blacklistedUploaders []string, info *TrackerMetadata) bool
- func (r *Release) IsMusicRelease() bool
- func (r *Release) Satisfies(filter *ConfigFilter) bool
- func (r *Release) ShortString() string
- func (r *Release) String() string
- func (r *Release) TorrentFile() string
- type ServerPage
- func (sc *ServerPage) DownloadsInfo(e *Environment, downloads *DownloadsDB, id string) ([]byte, error)
- func (sc *ServerPage) DownloadsList(downloads *DownloadsDB) ([]byte, error)
- func (sc *ServerPage) Index(downloads *DownloadsDB) ([]byte, error)
- func (sc *ServerPage) SaveIndex(e *Environment, file string) error
- type SnatchStatsEntry
- type SnatchStatsSeries
- type StatsDB
- func (sdb *StatsDB) AddSnatch(release Release) error
- func (sdb *StatsDB) AlreadySnatchedDuplicate(release *Release) bool
- func (sdb *StatsDB) AlreadySnatchedFromGroup(release *Release) bool
- func (sdb *StatsDB) FilterByTracker(tracker string, statsType string) ([]StatsEntry, error)
- func (sdb *StatsDB) GenerateAllGraphsForTracker(tracker string) error
- func (sdb *StatsDB) GetLastCollected(tracker string, limit int) ([]StatsEntry, error)
- func (sdb *StatsDB) Save(entry *StatsEntry) error
- func (sdb *StatsDB) Update() error
- type StatsDelta
- type StatsEntry
- func (se *StatsEntry) Diff(previous *StatsEntry) (int64, int64, int64, int64, float64)
- func (se *StatsEntry) IsProgressAcceptable(previous *StatsEntry, maxDecrease int, minimumRatio float64) bool
- func (se *StatsEntry) Progress(previous *StatsEntry) string
- func (se *StatsEntry) ProgressParts(previous *StatsEntry) []string
- func (se *StatsEntry) String() string
- func (se *StatsEntry) ToSlice() []string
- type StatsSeries
- type TrackerMetadata
- func (tm *TrackerMetadata) GeneratePath(folderTemplate, releaseFolder string) string
- func (tm *TrackerMetadata) HTMLDescription() string
- func (tm *TrackerMetadata) IsWellSeeded() bool
- func (tm *TrackerMetadata) Load(t *tracker.Gazelle, info *tracker.GazelleTorrent) error
- func (tm *TrackerMetadata) LoadFromID(t *tracker.Gazelle, id string) error
- func (tm *TrackerMetadata) LoadFromJSON(tracker string, originJSON, releaseJSON string) error
- func (tm *TrackerMetadata) LoadUserJSON(parentFolder string) error
- func (tm *TrackerMetadata) Release() *Release
- func (tm *TrackerMetadata) SaveCover(releaseFolder string) error
- func (tm *TrackerMetadata) SaveFromTracker(parentFolder string, t *tracker.Gazelle) error
- func (tm *TrackerMetadata) TextDescription(fancy bool) string
- func (tm *TrackerMetadata) UpdateUserJSON(destination, mainArtist, mainArtistAlias, category string) error
- func (tm *TrackerMetadata) WriteUserJSON(destination string) error
- type TrackerMetadataArtist
- type TrackerMetadataLineage
- type TrackerMetadataTrack
- type TrackerOriginJSON
- type WebHookJSON
- type WebHooksConfig
Constants ¶
const ( FullName = "varroa musica" FullNameAlt = "VarroaMusica" FullVersion = "%s -- %s." DefaultPIDFile = "varroa_pid" DefaultLogFile = "log" // directories & files DefaultConfigurationFile = "config.yaml" StatsDir = "stats" MetadataDir = "TrackerMetadata" OriginJSONFile = "origin.json" DefaultHistoryDB = "history.db" DefaultDownloadsDB = "downloads.db" DefaultLibraryDB = "library.db" // information InfoUserFilesArchived = "User files backed up." InfoUsage = "Before running a command that requires the daemon, run 'varroa start'." InfoEncrypted = "Configuration file encrypted. You can use this encrypted version in place of the unencrypted version." InfoDecrypted = "Configuration file has been decrypted to a plaintext YAML file." // cli errors ErrorArguments = "Error parsing command line arguments" ErrorInfoBadArguments = "Bad arguments" // daemon errors ErrorFindingDaemon = "Error finding daemon" ErrorGettingDaemonContext = "Error launching daemon (it probably is running already)" ErrorSendingCommandToDaemon = "Error sending command to daemon" // command check-log errors ErrorCheckingLog = "Error checking log" // command snatch errors ErrorSnatchingTorrent = "Error snatching torrent" // command info errors ErrorShowingTorrentInfo = "Error displaying torrent info" // command refresh-metadata errors ErrorRefreshingMetadata = "Error refreshing metadata" // command reseed ErrorReseed = "error trying to reseed release" ErrorSettingUp = "Error setting up" ErrorLoadingConfig = "Error loading configuration" ErrorFindingMusicAndMetadata = "directory %s does not contain music files and tracker metadata" ErrorGeneratingGraphs = "Error generating graphs (may require more data, 24h worth for daily graphs)" )
const ( ReleaseString = `` /* 195-byte string literal not displayed */ TorrentPath = `%s - %s (%d) [%s %s %s %s] - %s.torrent` TorrentNotification = `%s - %s (%d) [%s/%s/%s/%s] [%s]` )
const (
CSSTemplate = `` /* 7091-byte string literal not displayed */
)
Variables ¶
var DownloadFolderStates = []string{"unsorted", "UNUSED", "accepted", "rejected"}
var (
// Version will be updated by the Makefile at build time.
Version = "dev"
)
Functions ¶
func ArchiveUserFiles ¶
func ArchiveUserFiles() error
ArchiveUserFiles in a timestamped compressed archive.
func ColorizeDownloadState ¶
func DirectoryContainsMusicAndMetadata ¶
DirectoryContainsMusicAndMetadata returns true if it contains mp3 or flac files, and JSONs in a TrackerMetadata folder.
func DownloadState ¶
func GenerateStats ¶
func GenerateStats(e *Environment) error
GenerateStats for all labels and the associated HTML index.
func GetPassphrase ¶
func GoGoRoutines ¶
func GoGoRoutines(e *Environment, noDaemon bool)
func IsValidDownloadState ¶
func MatchAllInSlice ¶
MatchAllInSlice checks if all strings in slice a are in slice b
func MatchInSlice ¶
MatchInSlice checks if a string regexp-matches a slice of patterns, returns bool
func Notify ¶
func Notify(msg, tracker, msgType string, e *Environment) error
Notify in a goroutine, or directly.
func RefreshLibraryMetadata ¶
RefreshLibraryMetadata for a list of releases on a tracker, using the given location instead of assuming they are in the download directory.
func RefreshMetadata ¶
func RefreshMetadata(e *Environment, t *tracker.Gazelle, IDStrings []string) error
RefreshMetadata for a list of releases on a tracker
func ReorganizeLibrary ¶
ReorganizeLibrary using tracker metadata and the user-defined template
func SavePassphraseForDaemon ¶
SavePassphraseForDaemon saves the encrypted configuration file passphrase to env if necessary. In the daemon, retrieves that passphrase.
func SendOrders ¶
SendOrders from the CLI to the running daemon
func ShowTorrentInfo ¶
func ShowTorrentInfo(e *Environment, t *tracker.Gazelle, IDStrings []string) error
ShowTorrentInfo of a list of releases on a tracker
func SnatchTorrents ¶
SnatchTorrents on a tracker using their TorrentIDs
Types ¶
type Config ¶
type Config struct { General *ConfigGeneral Trackers []*ConfigTracker Autosnatch []*ConfigAutosnatch Stats []*ConfigStats WebServer *ConfigWebServer Notifications *ConfigNotifications GitlabPages *ConfigGitlabPages `yaml:"gitlab_pages"` Filters []*ConfigFilter Library *ConfigLibrary MPD *ConfigMPD Metadata *ConfigMetadata DownloadFolderConfigured bool LibraryConfigured bool // contains filtered or unexported fields }
func (*Config) GetAutosnatch ¶
func (c *Config) GetAutosnatch(label string) (*ConfigAutosnatch, error)
func (*Config) GetTracker ¶
func (c *Config) GetTracker(label string) (*ConfigTracker, error)
func (*Config) LoadFromBytes ¶
func (*Config) TrackerLabels ¶
type ConfigAutosnatch ¶
type ConfigAutosnatch struct { Tracker string LocalAddress string `yaml:"local_address"` IRCServer string `yaml:"irc_server"` IRCKey string `yaml:"irc_key"` IRCSSL bool `yaml:"irc_ssl"` IRCSSLSkipVerify bool `yaml:"irc_ssl_skip_verify"` NickservPassword string `yaml:"nickserv_password"` BotName string `yaml:"bot_name"` UseZNC bool `yaml:"use_znc"` ZNCNetwork string `yaml:"znc_network"` ZNCPassword string `yaml:"znc_password"` Announcer string AnnounceChannel string `yaml:"announce_channel"` BlacklistedUploaders []string `yaml:"blacklisted_uploaders"` // contains filtered or unexported fields }
func (*ConfigAutosnatch) String ¶
func (ca *ConfigAutosnatch) String() string
type ConfigFilter ¶
type ConfigFilter struct { Name string `yaml:"name"` Artist []string `yaml:"artist"` ExcludedArtist []string `yaml:"excluded_artist"` Year []int `yaml:"year"` YearRange []string `yaml:"year_range"` EditionYear []int `yaml:"edition_year"` EditionYearRange []string `yaml:"edition_year_range"` RecordLabel []string `yaml:"record_label"` TagsIncluded []string `yaml:"included_tags"` TagsExcluded []string `yaml:"excluded_tags"` TagsRequired []string `yaml:"required_tags"` ReleaseType []string `yaml:"type"` ExcludedReleaseType []string `yaml:"excluded_type"` Title []string `yaml:"title"` Edition []string `yaml:"edition"` Format []string `yaml:"format"` Source []string `yaml:"source"` Quality []string `yaml:"quality"` HasCue bool `yaml:"has_cue"` HasLog bool `yaml:"has_log"` LogScore int `yaml:"log_score"` PerfectFlac bool `yaml:"perfect_flac"` AllowDuplicates bool `yaml:"allow_duplicates"` AllowScene bool `yaml:"allow_scene"` MinSizeMB int `yaml:"min_size_mb"` MaxSizeMB int `yaml:"max_size_mb"` WatchDir string `yaml:"watch_directory"` UniqueInGroup bool `yaml:"unique_in_group"` Tracker []string `yaml:"tracker"` Uploader []string `yaml:"uploader"` RejectUnknown bool `yaml:"reject_unknown_releases"` RejectTrumpable bool `yaml:"reject_trumpable_releases"` BlacklistedUploaders []string `yaml:"blacklisted_uploaders"` }
func (*ConfigFilter) String ¶
func (cf *ConfigFilter) String() string
type ConfigGeneral ¶
type ConfigGeneral struct { LogLevel int `yaml:"log_level"` WatchDir string `yaml:"watch_directory"` DownloadDir string `yaml:"download_directory"` AutomaticMetadataRetrieval bool `yaml:"automatic_metadata_retrieval"` FullMetadataRetrieval bool `yaml:"full_metadata_retrieval"` TimestampedLogs bool `yaml:"timestamped_logs"` }
func (*ConfigGeneral) String ¶
func (cg *ConfigGeneral) String() string
String representation for ConfigGeneral.
type ConfigGitlabPages ¶
type ConfigGitlabPages struct { GitHTTPS string `yaml:"git_https"` User string Password string URL string Folder string }
func (*ConfigGitlabPages) String ¶
func (cg *ConfigGitlabPages) String() string
type ConfigLibrary ¶
type ConfigLibrary struct { Directory string `yaml:"directory"` UseHardLinks bool `yaml:"use_hard_links"` MoveSorted bool `yaml:"move_sorted"` AutomaticMode bool `yaml:"automatic_mode"` Template string `yaml:"folder_template"` AdditionalSources []string `yaml:"additional_source_directories"` AliasesFile string `yaml:"aliases_file"` Aliases map[string][]string `yaml:"-"` CategoriesFile string `yaml:"categories_file"` Categories map[string][]string `yaml:"-"` PlaylistDirectory string `yaml:"playlist_directory"` }
func (*ConfigLibrary) String ¶
func (cl *ConfigLibrary) String() string
type ConfigMetadata ¶
type ConfigMetadata struct {
DiscogsToken string `yaml:"discogs_token"`
}
func (*ConfigMetadata) String ¶
func (cm *ConfigMetadata) String() string
type ConfigNotifications ¶
type ConfigNotifications struct { Pushover *ConfigPushover WebHooks *WebHooksConfig Irc *ConfigIRC }
type ConfigPushover ¶
type ConfigPushover struct { User string Token string IncludeBufferGraph bool `yaml:"include_buffer_graph"` }
func (*ConfigPushover) String ¶
func (cp *ConfigPushover) String() string
type ConfigStats ¶
type ConfigStats struct { Tracker string UpdatePeriodH int `yaml:"update_period_hour"` MaxBufferDecreaseMB int `yaml:"max_buffer_decrease_by_period_mb"` MinimumRatio float64 `yaml:"min_ratio"` TargetRatio float64 `yaml:"target_ratio"` }
func (*ConfigStats) String ¶
func (cs *ConfigStats) String() string
type ConfigTracker ¶
type ConfigTracker struct { Name string User string Password string Cookie string APIKey string `yaml:"api_key"` URL string }
func (*ConfigTracker) String ¶
func (ct *ConfigTracker) String() string
type ConfigWebServer ¶
type ConfigWebServer struct { ServeMetadata bool `yaml:"serve_metadata"` ServeStats bool `yaml:"serve_stats"` Theme string `yaml:"theme"` User string `yaml:"stats_user"` Password string `yaml:"stats_password"` AllowDownloads bool `yaml:"allow_downloads"` Token string `yaml:"token"` PortHTTP int `yaml:"http_port"` PortHTTPS int `yaml:"https_port"` Hostname string `yaml:"https_hostname"` }
func (*ConfigWebServer) String ¶
func (cw *ConfigWebServer) String() string
type DownloadEntry ¶
type DownloadEntry struct { ID int `storm:"id,increment"` FolderName string `storm:"unique"` State int `storm:"index"` Tracker []string `storm:"index"` TrackerID []int `storm:"index"` Artists []string `storm:"index"` HasTrackerMetadata bool `storm:"index"` SchemaVersion int }
func (*DownloadEntry) Description ¶
func (d *DownloadEntry) Description(root string) string
func (*DownloadEntry) Load ¶
func (d *DownloadEntry) Load(root string) error
func (*DownloadEntry) RawShortString ¶
func (d *DownloadEntry) RawShortString() string
func (*DownloadEntry) ShortState ¶
func (d *DownloadEntry) ShortState() string
func (*DownloadEntry) ShortString ¶
func (d *DownloadEntry) ShortString() string
func (*DownloadEntry) Sort ¶
func (d *DownloadEntry) Sort(e *Environment, root string) error
func (*DownloadEntry) String ¶
func (d *DownloadEntry) String() string
type DownloadsDB ¶
type DownloadsDB struct {
// contains filtered or unexported fields
}
func NewDownloadsDB ¶
func NewDownloadsDB(path, root string, additionalSources []string) (*DownloadsDB, error)
func (*DownloadsDB) Clean ¶
func (d *DownloadsDB) Clean() error
func (*DownloadsDB) Close ¶
func (d *DownloadsDB) Close() error
func (*DownloadsDB) FindByArtist ¶
func (d *DownloadsDB) FindByArtist(artist string) []DownloadEntry
func (*DownloadsDB) FindByFolderName ¶
func (d *DownloadsDB) FindByFolderName(folderName string) (DownloadEntry, error)
func (*DownloadsDB) FindByID ¶
func (d *DownloadsDB) FindByID(id int) (DownloadEntry, error)
func (*DownloadsDB) FindByState ¶
func (d *DownloadsDB) FindByState(state string) []DownloadEntry
func (*DownloadsDB) RescanIDs ¶
func (d *DownloadsDB) RescanIDs(IDs []int) error
func (*DownloadsDB) RescanPath ¶
func (d *DownloadsDB) RescanPath(folderName string) error
func (*DownloadsDB) Scan ¶
func (d *DownloadsDB) Scan() error
func (*DownloadsDB) Sort ¶
func (d *DownloadsDB) Sort(e *Environment) error
func (*DownloadsDB) SortThisID ¶
func (d *DownloadsDB) SortThisID(e *Environment, id int, ignoreSorted bool) error
func (*DownloadsDB) String ¶
func (d *DownloadsDB) String() string
type Environment ¶
type Environment struct { Trackers map[string]*tracker.Gazelle // contains filtered or unexported fields }
Environment keeps track of all the context varroa needs.
func (*Environment) DeployToGitlabPages ¶
func (e *Environment) DeployToGitlabPages() error
DeployToGitlabPages with git wrapper
func (*Environment) GenerateIndex ¶
func (e *Environment) GenerateIndex() error
func (*Environment) LoadConfiguration ¶
func (e *Environment) LoadConfiguration() error
LoadConfiguration whether the configuration file is encrypted or not.
func (*Environment) SetConfig ¶
func (e *Environment) SetConfig(c *Config)
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func (*FS) Statfs ¶
func (f *FS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error
type FuseDir ¶
type FuseDir struct {
// contains filtered or unexported fields
}
FuseDir is a folder in the FUSE filesystem. Top directory == exposed categories, such as artists, tags. ex: artists/Radiohead/OK Computer/FILES
func (*FuseDir) ReadDirAll ¶
ReadDirAll returns directory entries for the FUSE filesystem
type FuseEntry ¶
type FuseEntry struct { ID int `storm:"id,increment"` FolderName string `storm:"unique"` Artists []string `storm:"index"` Tags []string `storm:"index"` Title string `storm:"index"` Year int `storm:"index"` Tracker []string `storm:"index"` RecordLabel string `storm:"index"` Source string `storm:"index"` Format string `storm:"index"` }
FuseEntry is the struct describing a release folder with tracker metadata. Only the FolderName is indexed.
type FuseFile ¶
type FuseFile struct {
// contains filtered or unexported fields
}
type FuseFileHandle ¶
type FuseFileHandle struct {
// contains filtered or unexported fields
}
func (*FuseFileHandle) Flush ¶
func (fh *FuseFileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error
func (*FuseFileHandle) Read ¶
func (fh *FuseFileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error
func (*FuseFileHandle) Release ¶
func (fh *FuseFileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) error
type FusePath ¶
type FusePath struct {
// contains filtered or unexported fields
}
FusePath holds all of the informations to generate a FUSE path.
func (*FusePath) SetCategory ¶
type HTMLIndex ¶
type HTMLIndex struct { Title string Time string Version string Stats []HTMLStats CSS template.CSS Script string ShowDownloads bool Downloads []DownloadEntry DownloadInfo template.HTML MainContent template.HTML URLFolder string }
HTMLIndex provides data for the htmlIndexTemplate.
func (*HTMLIndex) IndexDownloadsInfo ¶
func (*HTMLIndex) IndexDownloadsList ¶
func (*HTMLIndex) IndexStats ¶
IndexStats executes the template and save the result to a file.
func (*HTMLIndex) SetMainContentDownloadsInfo ¶
func (*HTMLIndex) SetMainContentDownloadsList ¶
func (*HTMLIndex) SetMainContentStats ¶
type HTMLStats ¶
type HTMLStats struct { Name string TrackerStats [][]string GraphLinks []HTMLLink Graphs []HTMLLink }
HTMLStats has all the information for a tracker: stats and graphs.
type HistoryTheme ¶
type HistoryTheme struct { GraphTransparentBackground bool GraphColor string GraphFillerOpacity uint8 GraphAxisColor string IndexBackgroundColor string IndexFontColor string IndexMenuColor string IndexMenuLinkColor string IndexMenuBackgroundColor string IndexMenuHeaderColor string }
func (HistoryTheme) CSS ¶
func (ht HistoryTheme) CSS() template.CSS
type IncomingJSON ¶
IncomingJSON from the websocket created by the GM script, also used with unix socket.
type MPD ¶
type MPD struct {
// contains filtered or unexported fields
}
func (*MPD) DisableAndDisconnect ¶
func (*MPD) Enable ¶
Enable a path outside of MPD library This adds the symlink inside the MPD library to the specified path
func (*MPD) SendAndPlay ¶
type Notification ¶
type Notification struct {
// contains filtered or unexported fields
}
type OriginJSON ¶
type OutgoingJSON ¶
OutgoingJSON to the websocket created by the GM script.
type Release ¶
type Release struct { ID uint32 `storm:"id,increment"` Tracker string `storm:"index"` Timestamp time.Time TorrentID string `storm:"index"` GroupID string Artists []string Title string Year int ReleaseType string Format string Quality string HasLog bool LogScore int HasCue bool IsScene bool Source string Tags []string Size uint64 Folder string Filter string // contains filtered or unexported fields }
func NewRelease ¶
func (*Release) HasCompatibleTrackerInfo ¶
func (r *Release) HasCompatibleTrackerInfo(filter *ConfigFilter, blacklistedUploaders []string, info *TrackerMetadata) bool
func (*Release) IsMusicRelease ¶
IsMusicRelease returns false if the release has no artists
func (*Release) Satisfies ¶
func (r *Release) Satisfies(filter *ConfigFilter) bool
func (*Release) ShortString ¶
func (*Release) TorrentFile ¶
type ServerPage ¶
type ServerPage struct {
// contains filtered or unexported fields
}
func (*ServerPage) DownloadsInfo ¶
func (sc *ServerPage) DownloadsInfo(e *Environment, downloads *DownloadsDB, id string) ([]byte, error)
func (*ServerPage) DownloadsList ¶
func (sc *ServerPage) DownloadsList(downloads *DownloadsDB) ([]byte, error)
func (*ServerPage) Index ¶
func (sc *ServerPage) Index(downloads *DownloadsDB) ([]byte, error)
func (*ServerPage) SaveIndex ¶
func (sc *ServerPage) SaveIndex(e *Environment, file string) error
SaveIndex is only used for Gitlab pages, so it never shows Downloads and will need to know the repository name (ie Pages subfolder).
type SnatchStatsEntry ¶
type SnatchStatsSeries ¶
SnatchStatsSeries is a struct that holds the SnatchStats data needed to generate time series graphs. It can then draw and save the graphs (for raw stats or stats/time unit)
func (*SnatchStatsSeries) AddStats ¶
func (sss *SnatchStatsSeries) AddStats(entries ...SnatchStatsEntry)
AddStats for all entries or a selection to get the correct timeseries
func (*SnatchStatsSeries) GenerateGraphs ¶
func (sss *SnatchStatsSeries) GenerateGraphs(directory, prefix string, firstTimestamp time.Time, addSMA bool) error
GenerateGraphs: time series graphs for size, number
type StatsDB ¶
type StatsDB struct {
// contains filtered or unexported fields
}
func NewStatsDB ¶
func (*StatsDB) AlreadySnatchedDuplicate ¶
func (*StatsDB) AlreadySnatchedFromGroup ¶
func (*StatsDB) FilterByTracker ¶
func (sdb *StatsDB) FilterByTracker(tracker string, statsType string) ([]StatsEntry, error)
func (*StatsDB) GenerateAllGraphsForTracker ¶
func (*StatsDB) GetLastCollected ¶
func (sdb *StatsDB) GetLastCollected(tracker string, limit int) ([]StatsEntry, error)
func (*StatsDB) Save ¶
func (sdb *StatsDB) Save(entry *StatsEntry) error
type StatsDelta ¶
type StatsDelta struct { Tracker string Timestamp time.Time Up int64 Down int64 Ratio float64 Buffer int64 WarningBuffer int64 }
func CalculateDelta ¶
func CalculateDelta(first, second StatsEntry) (*StatsDelta, error)
func CalculateDeltas ¶
func CalculateDeltas(entries []StatsEntry) []StatsDelta
type StatsEntry ¶
type StatsEntry struct { ID uint32 `storm:"id,increment"` Tracker string `storm:"index"` Up uint64 Down uint64 Ratio float64 Timestamp time.Time TimestampUnix int64 `storm:"index"` Collected bool `storm:"index"` StartOfDay bool `storm:"index"` StartOfWeek bool `storm:"index"` StartOfMonth bool `storm:"index"` SchemaVersion int }
func InterpolateStats ¶
func InterpolateStats(previous, next StatsEntry, targetTime time.Time) (*StatsEntry, error)
func NewStatsEntry ¶
func NewStatsEntry(gazelleTracker *tracker.Gazelle, gzStats *tracker.GazelleUserStats) (*StatsEntry, error)
func (*StatsEntry) Diff ¶
func (se *StatsEntry) Diff(previous *StatsEntry) (int64, int64, int64, int64, float64)
TODO REPLACE BY A DELTA
func (*StatsEntry) IsProgressAcceptable ¶
func (se *StatsEntry) IsProgressAcceptable(previous *StatsEntry, maxDecrease int, minimumRatio float64) bool
func (*StatsEntry) Progress ¶
func (se *StatsEntry) Progress(previous *StatsEntry) string
func (*StatsEntry) ProgressParts ¶
func (se *StatsEntry) ProgressParts(previous *StatsEntry) []string
TODO do something about this awful thing
func (*StatsEntry) String ¶
func (se *StatsEntry) String() string
func (*StatsEntry) ToSlice ¶
func (se *StatsEntry) ToSlice() []string
TODO reimplement export to CSV
type StatsSeries ¶
type StatsSeries struct { Tracker string Time []time.Time Up []float64 Down []float64 Ratio []float64 Buffer []float64 WarningBuffer []float64 }
StatsSeries is a struct that holds the Stats data needed to generate time series graphs. It can then draw and save the graphs (for raw stats or stats/time unit)
func (*StatsSeries) AddDeltas ¶
func (ss *StatsSeries) AddDeltas(entries ...StatsDelta) error
AddDeltas accumulates the data from a selection of StatsDeltas
func (*StatsSeries) AddStats ¶
func (ss *StatsSeries) AddStats(entries ...StatsEntry) error
AddStats for all entries or a selection to get the correct timeseries
func (*StatsSeries) GenerateGraphs ¶
func (ss *StatsSeries) GenerateGraphs(directory, prefix string, firstTimestamp time.Time, addSMA bool) error
GenerateGraphs: time series graphs for up, down, ratio, buffer, warningbuffer
type TrackerMetadata ¶
type TrackerMetadata struct { // JSONs ReleaseJSON []byte `json:"-"` OriginJSON []byte `json:"-"` // tracker related metadata ID int GroupID int Tracker string TrackerURL string ReleaseURL string TimeSnatched int64 LastUpdated int64 IsAlive bool Size uint64 Uploader string FolderName string CoverURL string // release related metadata Artists []TrackerMetadataArtist Title string Tags []string ReleaseType string RecordLabel string CatalogNumber string OriginalYear int EditionName string EditionYear int Source string SourceFull string Format string Quality string LogScore int HasLog bool HasCue bool IsScene bool // for library organization MainArtist string MainArtistAlias string Category string // contents Tracks []TrackerMetadataTrack TotalTime string Lineage []TrackerMetadataLineage Description string // current tracker state CurrentSeeders int `json:"-"` Reported bool `json:"-"` Trumpable bool `json:"-"` ApprovedLossy bool `json:"-"` }
func (*TrackerMetadata) GeneratePath ¶
func (tm *TrackerMetadata) GeneratePath(folderTemplate, releaseFolder string) string
func (*TrackerMetadata) HTMLDescription ¶
func (tm *TrackerMetadata) HTMLDescription() string
func (*TrackerMetadata) IsWellSeeded ¶
func (tm *TrackerMetadata) IsWellSeeded() bool
IsWellSeeded if it has more than minimumSeeders.
func (*TrackerMetadata) Load ¶
func (tm *TrackerMetadata) Load(t *tracker.Gazelle, info *tracker.GazelleTorrent) error
func (*TrackerMetadata) LoadFromID ¶
func (tm *TrackerMetadata) LoadFromID(t *tracker.Gazelle, id string) error
LoadFromID directly from tracker
func (*TrackerMetadata) LoadFromJSON ¶
func (tm *TrackerMetadata) LoadFromJSON(tracker string, originJSON, releaseJSON string) error
func (*TrackerMetadata) LoadUserJSON ¶
func (tm *TrackerMetadata) LoadUserJSON(parentFolder string) error
func (*TrackerMetadata) Release ¶
func (tm *TrackerMetadata) Release() *Release
func (*TrackerMetadata) SaveCover ¶
func (tm *TrackerMetadata) SaveCover(releaseFolder string) error
func (*TrackerMetadata) SaveFromTracker ¶
func (tm *TrackerMetadata) SaveFromTracker(parentFolder string, t *tracker.Gazelle) error
SaveFromTracker all of the relevant metadata.
func (*TrackerMetadata) TextDescription ¶
func (tm *TrackerMetadata) TextDescription(fancy bool) string
func (*TrackerMetadata) UpdateUserJSON ¶
func (tm *TrackerMetadata) UpdateUserJSON(destination, mainArtist, mainArtistAlias, category string) error
func (*TrackerMetadata) WriteUserJSON ¶
func (tm *TrackerMetadata) WriteUserJSON(destination string) error
type TrackerMetadataArtist ¶
type TrackerMetadataLineage ¶
type TrackerMetadataTrack ¶
type TrackerMetadataTrack struct { Disc string Number string Title string Duration string Size string }
func (*TrackerMetadataTrack) String ¶
func (rit *TrackerMetadataTrack) String() string
type TrackerOriginJSON ¶
type TrackerOriginJSON struct { Path string `json:"-"` Origins map[string]*OriginJSON `json:"known_origins"` }
TrackerOriginJSON contains the list of trackers of origin for a release.
func (*TrackerOriginJSON) Load ¶
func (toc *TrackerOriginJSON) Load() error
type WebHookJSON ¶
type WebHooksConfig ¶
func (*WebHooksConfig) String ¶
func (whc *WebHooksConfig) String() string
Source Files ¶
- commands.go
- config.go
- config_crypto.go
- config_sections.go
- constants.go
- db.go
- downloads_db.go
- downloads_entry.go
- environment.go
- fuse_attr_linux.go
- fuse_db.go
- fuse_dir.go
- fuse_file.go
- fuse_fs.go
- fuse_path.go
- graphs.go
- irc.go
- library.go
- mpd.go
- notifications.go
- playlist.go
- release.go
- server.go
- server_certificates.go
- server_contents.go
- server_page.go
- server_theme.go
- stats.go
- stats_db.go
- stats_entry.go
- stats_graphs.go
- tracker_metadata.go
- tracker_origin.go
- utils.go