Documentation
¶
Index ¶
- func CopyFile(src, dst string) (err error)
- type ClientMigrater
- type ClientType
- type DelugeImport
- type Fastresume
- type Migrater
- type Options
- type PathReplace
- type RTorrentImport
- type RTorrentLibTorrentResumeFile
- type RTorrentResumeFileEntry
- type RTorrentTorrentFile
- type TransmissionImport
- type TransmissionResumeFile
- type TransmissionResumeFileIdleLimit
- type TransmissionResumeFileProgress
- type TransmissionResumeFileRatioLimit
- type TransmissionResumeFileSpeedLimit
- type UTorrentImport
- type UTorrentResumeItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile copies the file named src to dst with the mode of src. It writes a temp file next to dst and renames it into place after the data is synced, so a failed copy never leaves a partial dst: the importers treat an existing dst as already imported and would skip it on the next run
Types ¶
type ClientMigrater ¶
type ClientMigrater interface {
Migrate() error
}
type ClientType ¶
type ClientType string
var ( ClientTypeDeluge ClientType = "deluge" ClientTypeRTorrent ClientType = "rtorrent" ClientTypeTransmission ClientType = "transmission" ClientTypeUTorrent ClientType = "utorrent" )
type DelugeImport ¶
type DelugeImport struct {
// contains filtered or unexported fields
}
func NewDelugeImporter ¶
func NewDelugeImporter(opts Options) *DelugeImport
func (*DelugeImport) Migrate ¶
func (di *DelugeImport) Migrate() error
type Fastresume ¶
type Fastresume struct {
ActiveTime int64 `bencode:"active_time"`
AddedTime int64 `bencode:"added_time"`
Allocation string `bencode:"allocation"`
ApplyIPFilter int64 `bencode:"apply_ip_filter"`
AnnounceToDht int64 `bencode:"announce_to_dht,omitempty"`
AnnounceToLsd int64 `bencode:"announce_to_lsd,omitempty"`
AnnounceToTrackers int64 `bencode:"announce_to_trackers,omitempty"`
AutoManaged int64 `bencode:"auto_managed"`
CompletedTime int64 `bencode:"completed_time"`
DisableDHT int64 `bencode:"disable_dht"`
DisableLSD int64 `bencode:"disable_lsd"`
DisablePEX int64 `bencode:"disable_pex"`
DownloadRateLimit int64 `bencode:"download_rate_limit"`
FileFormat string `bencode:"file-format"`
FileVersion int64 `bencode:"file-version"`
FilePriority []int `bencode:"file_priority"`
FileSizes [][]int64 `bencode:"file sizes,omitempty"`
FinishedTime int64 `bencode:"finished_time"`
HTTPSeeds []string `bencode:"httpseeds,omitempty"`
InfoHash []byte `bencode:"info-hash"`
LastDownload int64 `bencode:"last_download"`
LastSeenComplete int64 `bencode:"last_seen_complete"`
LastUpload int64 `bencode:"last_upload"`
LibTorrentVersion string `bencode:"libtorrent-version"`
MaxConnections int64 `bencode:"max_connections"`
MaxUploads int64 `bencode:"max_uploads"`
Name string `bencode:"name,omitempty"`
NumComplete int64 `bencode:"num_complete"`
NumDownloaded int64 `bencode:"num_downloaded"`
NumIncomplete int64 `bencode:"num_incomplete"`
Paused int64 `bencode:"paused"`
Pieces string `bencode:"pieces"`
PiecePriority []byte `bencode:"piece_priority"`
Peers string `bencode:"peers"`
Peers6 string `bencode:"peers6"`
QbtCategory string `bencode:"qBt-category"`
QbtContentLayout string `bencode:"qBt-contentLayout"`
QbtHasRootFolder int64 `bencode:"qBt-hasRootFolder"`
QbtFirstLastPiecePriority int64 `bencode:"qBt-firstLastPiecePriority"`
QbtName string `bencode:"qBt-name"`
QbtRatioLimit int64 `bencode:"qBt-ratioLimit"`
QbtSavePath string `bencode:"qBt-savePath"`
QbtSeedStatus int64 `bencode:"qBt-seedStatus"`
QbtSeedingTimeLimit int64 `bencode:"qBt-seedingTimeLimit"`
QbtTags []string `bencode:"qBt-tags"`
QbtQueuePosition int `bencode:"qBt-queuePosition,omitempty"`
QbtTempPathDisabled int64 `bencode:"qBt-tempPathDisabled,omitempty"`
SavePath string `bencode:"save_path"`
SeedMode int64 `bencode:"seed_mode"`
SeedingTime int64 `bencode:"seeding_time"`
SequentialDownload int64 `bencode:"sequential_download"`
StopWhenReady int64 `bencode:"stop_when_ready"`
SuperSeeding int64 `bencode:"super_seeding"`
TotalDownloaded int64 `bencode:"total_downloaded"`
TotalUploaded int64 `bencode:"total_uploaded"`
Trackers [][]string `bencode:"trackers,omitempty"`
UploadMode int64 `bencode:"upload_mode"`
UploadRateLimit int64 `bencode:"upload_rate_limit"`
URLList []string `bencode:"url-list"`
Unfinished *[]any `bencode:"unfinished,omitempty"`
TorrentFilePath string `bencode:"-"`
MappedFiles []string `bencode:"mapped_files,omitempty"`
}
Fastresume represents a qBittorrent fastresume file
func (*Fastresume) ConvertFilePriority ¶
func (fr *Fastresume) ConvertFilePriority(numFiles int)
ConvertFilePriority for each file set priority
func (*Fastresume) Encode ¶
func (fr *Fastresume) Encode(path string) error
Encode qBittorrent fastresume file
type Options ¶
type Options struct {
Source ClientType
SourceDir string
QbitDir string
DryRun bool
SkipBackup bool
PathReplaces []PathReplace
}
type PathReplace ¶ added in v1.34.0
PathReplace rewrites save paths that start with From to start with To
func ParsePathReplace ¶ added in v1.34.0
func ParsePathReplace(rule string) (PathReplace, error)
ParsePathReplace parses a from=to rule. To must be an absolute path on this host; From is a path as the source client stored it
type RTorrentImport ¶
type RTorrentImport struct {
// contains filtered or unexported fields
}
func NewRTorrentImporter ¶
func NewRTorrentImporter(opts Options) *RTorrentImport
func (*RTorrentImport) Migrate ¶
func (i *RTorrentImport) Migrate() error
type RTorrentLibTorrentResumeFile ¶
type RTorrentLibTorrentResumeFile struct {
Bitfield any `bencode:"bitfield"`
Files []RTorrentResumeFileEntry `bencode:"files"`
Trackers map[string]map[string]int `bencode:"trackers"`
}
type RTorrentResumeFileEntry ¶
type RTorrentTorrentFile ¶
type RTorrentTorrentFile struct {
Complete int64 `bencode:"complete"`
Custom struct {
AddTime string `bencode:"addtime"`
SeedingTime string `bencode:"seedingtime"`
} `bencode:"custom"`
Custom1 string `bencode:"custom1"`
Directory string `bencode:"directory"`
State int64 `bencode:"state"`
TotalDownloaded int64 `bencode:"total_downloaded"`
TotalUploaded int64 `bencode:"total_uploaded"`
TimestampFinished int64 `bencode:"timestamp.finished"`
TimestampStarted int64 `bencode:"timestamp.started"`
}
type TransmissionImport ¶
type TransmissionImport struct {
// contains filtered or unexported fields
}
func NewTransmissionImporter ¶
func NewTransmissionImporter(opts Options) *TransmissionImport
func (*TransmissionImport) Migrate ¶
func (i *TransmissionImport) Migrate() error
type TransmissionResumeFile ¶
type TransmissionResumeFile struct {
Files []string `bencode:"files"`
Name string `bencode:"name"`
Corrupted int64 `bencode:"corrupt"`
Destination string `bencode:"destination"`
IncompleteDir string `bencode:"incomplete-dir"`
Downloaded int64 `bencode:"downloaded"`
Uploaded int64 `bencode:"uploaded"`
Group string `bencode:"group"`
BandwidthPriority int `bencode:"bandwidth-priority"`
Priority []int `bencode:"priority"`
DoneDate int64 `bencode:"done-date"`
DownloadingTimeSeconds int64 `bencode:"downloading-time-seconds"`
Labels []string `bencode:"labels"`
MaxPeers int64 `bencode:"max-peers"`
Paused bool `bencode:"paused"`
ActivityDate int64 `bencode:"activity-date"`
AddedDate int64 `bencode:"added-date"`
Dnd []int `bencode:"dnd"`
SeedingTimeSeconds int64 `bencode:"seeding-time-seconds"`
Progress TransmissionResumeFileProgress `bencode:"progress"`
IdleLimit TransmissionResumeFileIdleLimit `bencode:"idle-limit"`
RatioLimit TransmissionResumeFileRatioLimit `bencode:"ratio-limit"`
SpeedLimitUp TransmissionResumeFileSpeedLimit `bencode:"speed-limit-up"`
SpeedLimitDown TransmissionResumeFileSpeedLimit `bencode:"speed-limit-down"`
}
type UTorrentImport ¶ added in v1.34.0
type UTorrentImport struct {
// contains filtered or unexported fields
}
func NewUTorrentImporter ¶ added in v1.34.0
func NewUTorrentImporter(opts Options) *UTorrentImport
func (*UTorrentImport) Migrate ¶ added in v1.34.0
func (i *UTorrentImport) Migrate() error
type UTorrentResumeItem ¶ added in v1.34.0
type UTorrentResumeItem struct {
AddedOn int64 `bencode:"added_on"`
Caption string `bencode:"caption"`
CompletedOn int64 `bencode:"completed_on"`
Downloaded int64 `bencode:"downloaded"`
DownSpeed int64 `bencode:"downspeed"`
Have string `bencode:"have"`
Info []byte `bencode:"info"`
Label string `bencode:"label"`
Labels []string `bencode:"labels"`
LastSeenComplete int64 `bencode:"last_seen_complete"`
OverrideSeedSettings int64 `bencode:"override_seedsettings"`
Path string `bencode:"path"`
Prio string `bencode:"prio"`
Runtime int64 `bencode:"runtime"`
SeedTime int64 `bencode:"seedtime"`
Started int64 `bencode:"started"`
Targets [][]any `bencode:"targets"`
Trackers any `bencode:"trackers"`
Uploaded int64 `bencode:"uploaded"`
UpSpeed int64 `bencode:"upspeed"`
WantedRatio int64 `bencode:"wanted_ratio"`
}
Click to show internal directories.
Click to hide internal directories.