@@ -8,6 +8,40 @@ import (
8
8
)
9
9
10
10
type Database interface {
11
+ Settings
12
+
13
+ MediaApis
14
+
15
+ EpisodeApis
16
+
17
+ IndexerApis
18
+
19
+ HistoryApis
20
+
21
+ SaveDownloader (downloader * ent.DownloadClients ) error
22
+ GetAllDonloadClients () []* ent.DownloadClients
23
+ DeleteDownloadCLient (id int )
24
+ GetDownloadClient (id int ) (* ent.DownloadClients , error )
25
+
26
+ AddStorage (st * StorageInfo ) error
27
+ GetAllStorage () []* ent.Storage
28
+ GetStorage (id int ) * Storage
29
+ DeleteStorage (id int ) error
30
+ SetDefaultStorage (id int ) error
31
+ SetDefaultStorageByName (name string ) error
32
+
33
+ GetAllImportLists () ([]* ent.ImportList , error )
34
+ AddImportlist (il * ent.ImportList ) error
35
+ DeleteImportlist (id int ) error
36
+
37
+ GetAllNotificationClients2 () ([]* ent.NotificationClient , error )
38
+ GetAllNotificationClients () ([]* NotificationClient , error )
39
+ AddNotificationClient (name , service string , setting string , enabled bool ) error
40
+ DeleteNotificationClient (id int ) error
41
+ GetNotificationClient (id int ) (* NotificationClient , error )
42
+ }
43
+
44
+ type Settings interface {
11
45
GetSetting (key string ) string
12
46
SetSetting (key , value string ) error
13
47
GetLanguage () string
@@ -22,6 +56,9 @@ type Database interface {
22
56
SetAcceptedSubtitleFormats (key string , v []string ) error
23
57
GetTmdbApiKey () string
24
58
59
+ }
60
+
61
+ type MediaApis interface {
25
62
AddMediaWatchlist (m * ent.Media , episodes []int ) (* ent.Media , error )
26
63
GetMediaWatchlist (mediaType media.MediaType ) []* ent.Media
27
64
GetMediaDetails (id int ) (* MediaDetails , error )
@@ -31,7 +68,9 @@ type Database interface {
31
68
EditMediaMetadata (in EditMediaData ) error
32
69
GetSizeLimiter (mediaType string ) (* MediaSizeLimiter , error )
33
70
SetSizeLimiter (mediaType string , limiter * MediaSizeLimiter ) error
71
+ }
34
72
73
+ type EpisodeApis interface {
35
74
GetEpisode (seriesId , seasonNum , episodeNum int ) (* ent.Episode , error )
36
75
GetEpisodeByID (epID int ) (* ent.Episode , error )
37
76
UpdateEpiode (episodeId int , name , overview string ) error
@@ -47,39 +86,23 @@ type Database interface {
47
86
GetSeasonEpisodes (mediaId , seasonNum int ) ([]* ent.Episode , error )
48
87
CleanAllDanglingEpisodes () error
49
88
89
+ }
90
+
91
+ type IndexerApis interface {
50
92
SaveIndexer (in * ent.Indexers ) error
51
93
DeleteIndexer (id int )
52
94
GetIndexer (id int ) (* ent.Indexers , error )
53
95
GetAllIndexers () []* ent.Indexers
54
96
55
- SaveDownloader (downloader * ent.DownloadClients ) error
56
- GetAllDonloadClients () []* ent.DownloadClients
57
- DeleteDownloadCLient (id int )
58
- GetDownloadClient (id int ) (* ent.DownloadClients , error )
59
-
60
- AddStorage (st * StorageInfo ) error
61
- GetAllStorage () []* ent.Storage
62
- GetStorage (id int ) * Storage
63
- DeleteStorage (id int ) error
64
- SetDefaultStorage (id int ) error
65
- SetDefaultStorageByName (name string ) error
97
+ }
66
98
99
+ type HistoryApis interface {
67
100
SaveHistoryRecord (h ent.History ) (* ent.History , error )
68
101
SetHistoryStatus (id int , status history.Status ) error
69
102
GetRunningHistories () ent.Histories
70
103
GetHistory (id int ) * ent.History
71
104
GetHistories () ent.Histories
72
105
DeleteHistory (id int ) error
73
106
GetDownloadHistory (mediaID int ) ([]* ent.History , error )
74
- GetMovieDummyEpisode (movieId int ) (* ent.Episode , error )
75
-
76
- GetAllImportLists () ([]* ent.ImportList , error )
77
- AddImportlist (il * ent.ImportList ) error
78
- DeleteImportlist (id int ) error
79
-
80
- GetAllNotificationClients2 () ([]* ent.NotificationClient , error )
81
- GetAllNotificationClients () ([]* NotificationClient , error )
82
- AddNotificationClient (name , service string , setting string , enabled bool ) error
83
- DeleteNotificationClient (id int ) error
84
- GetNotificationClient (id int ) (* NotificationClient , error )
85
- }
107
+ GetMovieDummyEpisode (movieId int ) (* ent.Episode , error )
108
+ }
0 commit comments