Add album/track releases with audio analysis, AnalyzeAlbumRelease RPC, Docker path auto-resolution, release parsing decision tree
This commit is contained in:
@@ -81,11 +81,12 @@ func (m *mockMetadataClient) SyncArtist(ctx context.Context, in *metadataPb.Sync
|
||||
}
|
||||
|
||||
type mockTorrentClient struct {
|
||||
LoginFunc func(username, password string) (string, error)
|
||||
ListFunc func() ([]torrent.TorrentInfo, error)
|
||||
FindFunc func(opts torrent.FindOptions) ([]torrent.TorrentInfo, error)
|
||||
AddTorrentFunc func(file torrent.TorrentFile) error
|
||||
AddMagnetFunc func(magnetURI string) error
|
||||
LoginFunc func(username, password string) (string, error)
|
||||
ListFunc func() ([]torrent.TorrentInfo, error)
|
||||
FindFunc func(opts torrent.FindOptions) ([]torrent.TorrentInfo, error)
|
||||
AddTorrentFunc func(file torrent.TorrentFile, savePath string) error
|
||||
AddMagnetFunc func(magnetURI string, savePath string) error
|
||||
DefaultSavePathFunc func() (string, error)
|
||||
}
|
||||
|
||||
func (m *mockTorrentClient) Login(username, password string) (string, error) {
|
||||
@@ -109,20 +110,27 @@ func (m *mockTorrentClient) Find(opts torrent.FindOptions) ([]torrent.TorrentInf
|
||||
return nil, fmt.Errorf("not mocked")
|
||||
}
|
||||
|
||||
func (m *mockTorrentClient) AddTorrent(file torrent.TorrentFile) error {
|
||||
func (m *mockTorrentClient) AddTorrent(file torrent.TorrentFile, savePath string) error {
|
||||
if m.AddTorrentFunc != nil {
|
||||
return m.AddTorrentFunc(file)
|
||||
return m.AddTorrentFunc(file, savePath)
|
||||
}
|
||||
return fmt.Errorf("not mocked")
|
||||
}
|
||||
|
||||
func (m *mockTorrentClient) AddMagnet(magnetURI string) error {
|
||||
func (m *mockTorrentClient) AddMagnet(magnetURI string, savePath string) error {
|
||||
if m.AddMagnetFunc != nil {
|
||||
return m.AddMagnetFunc(magnetURI)
|
||||
return m.AddMagnetFunc(magnetURI, savePath)
|
||||
}
|
||||
return fmt.Errorf("not mocked")
|
||||
}
|
||||
|
||||
func (m *mockTorrentClient) DefaultSavePath() (string, error) {
|
||||
if m.DefaultSavePathFunc != nil {
|
||||
return m.DefaultSavePathFunc()
|
||||
}
|
||||
return "/downloads", nil
|
||||
}
|
||||
|
||||
type mockSearcher struct {
|
||||
SearchFunc func(query string, limit int32, indexer string) (*indexer.SearchResponse, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user