Updste repair
This commit is contained in:
@@ -919,6 +919,7 @@ func (r *RealDebrid) GetProfile() (*types.Profile, error) {
|
||||
Expiration: data.Expiration,
|
||||
Type: data.Type,
|
||||
}
|
||||
r.Profile = profile
|
||||
return profile, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -570,6 +570,10 @@ func (c *Cache) GetTorrentByName(name string) *CachedTorrent {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Cache) GetTorrentsName() map[string]CachedTorrent {
|
||||
return c.torrents.getAllByName()
|
||||
}
|
||||
|
||||
func (c *Cache) GetTorrent(torrentId string) *CachedTorrent {
|
||||
if torrent, ok := c.torrents.getByID(torrentId); ok {
|
||||
return &torrent
|
||||
|
||||
@@ -293,6 +293,16 @@ func (tc *torrentCache) getAllCount() int {
|
||||
return len(tc.torrents.byID)
|
||||
}
|
||||
|
||||
func (tc *torrentCache) getAllByName() map[string]CachedTorrent {
|
||||
tc.torrents.RLock()
|
||||
defer tc.torrents.RUnlock()
|
||||
results := make(map[string]CachedTorrent, len(tc.torrents.byName))
|
||||
for name, torrent := range tc.torrents.byName {
|
||||
results[name] = torrent
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
func (tc *torrentCache) getIdMaps() map[string]struct{} {
|
||||
tc.torrents.RLock()
|
||||
defer tc.torrents.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user