mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(releases): add info url link to releases list (#683)
* feat(indexers): definitions add infourl to irc parsing * feat(indexers): add infourl to releases * fix(indexers): fix info urls * fix(indexers): update btn
This commit is contained in:
parent
870e109f6c
commit
4c83787a0b
68 changed files with 189 additions and 13 deletions
|
@ -199,6 +199,8 @@ CREATE TABLE "release"
|
|||
protocol TEXT,
|
||||
implementation TEXT,
|
||||
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
info_url TEXT,
|
||||
download_url TEXT,
|
||||
group_id TEXT,
|
||||
torrent_id TEXT,
|
||||
torrent_name TEXT,
|
||||
|
@ -647,4 +649,10 @@ UPDATE release_action_status
|
|||
SET filter_id = (SELECT f.id
|
||||
FROM filter f WHERE f.name = release_action_status.filter);
|
||||
`,
|
||||
`ALTER TABLE "release"
|
||||
ADD COLUMN info_url TEXT;
|
||||
|
||||
ALTER TABLE "release"
|
||||
ADD COLUMN download_url TEXT;
|
||||
`,
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ func (repo *ReleaseRepo) Store(ctx context.Context, r *domain.Release) (*domain.
|
|||
|
||||
queryBuilder := repo.db.squirrel.
|
||||
Insert("release").
|
||||
Columns("filter_status", "rejections", "indexer", "filter", "protocol", "implementation", "timestamp", "group_id", "torrent_id", "torrent_name", "size", "title", "category", "season", "episode", "year", "resolution", "source", "codec", "container", "hdr", "release_group", "proper", "repack", "website", "type", "origin", "tags", "uploader", "pre_time", "filter_id").
|
||||
Values(r.FilterStatus, pq.Array(r.Rejections), r.Indexer, r.FilterName, r.Protocol, r.Implementation, r.Timestamp.Format(time.RFC3339), r.GroupID, r.TorrentID, r.TorrentName, r.Size, r.Title, r.Category, r.Season, r.Episode, r.Year, r.Resolution, r.Source, codecStr, r.Container, hdrStr, r.Group, r.Proper, r.Repack, r.Website, r.Type, r.Origin, pq.Array(r.Tags), r.Uploader, r.PreTime, r.FilterID).
|
||||
Columns("filter_status", "rejections", "indexer", "filter", "protocol", "implementation", "timestamp", "group_id", "torrent_id", "info_url", "download_url", "torrent_name", "size", "title", "category", "season", "episode", "year", "resolution", "source", "codec", "container", "hdr", "release_group", "proper", "repack", "website", "type", "origin", "tags", "uploader", "pre_time", "filter_id").
|
||||
Values(r.FilterStatus, pq.Array(r.Rejections), r.Indexer, r.FilterName, r.Protocol, r.Implementation, r.Timestamp.Format(time.RFC3339), r.GroupID, r.TorrentID, r.InfoURL, r.TorrentURL, r.TorrentName, r.Size, r.Title, r.Category, r.Season, r.Episode, r.Year, r.Resolution, r.Source, codecStr, r.Container, hdrStr, r.Group, r.Proper, r.Repack, r.Website, r.Type, r.Origin, pq.Array(r.Tags), r.Uploader, r.PreTime, r.FilterID).
|
||||
Suffix("RETURNING id").RunWith(repo.db.handler)
|
||||
|
||||
// return values
|
||||
|
@ -205,7 +205,7 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
|
|||
}
|
||||
|
||||
queryBuilder := repo.db.squirrel.
|
||||
Select("r.id", "r.filter_status", "r.rejections", "r.indexer", "r.filter", "r.protocol", "r.title", "r.torrent_name", "r.size", "r.timestamp",
|
||||
Select("r.id", "r.filter_status", "r.rejections", "r.indexer", "r.filter", "r.protocol", "r.info_url", "r.download_url", "r.title", "r.torrent_name", "r.size", "r.timestamp",
|
||||
"ras.id", "ras.status", "ras.action", "ras.type", "ras.client", "ras.filter", "ras.rejections", "ras.timestamp").
|
||||
Column(sq.Alias(countQuery, "page_total")).
|
||||
From("release r").
|
||||
|
@ -239,14 +239,14 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
|
|||
var rls domain.Release
|
||||
var ras domain.ReleaseActionStatus
|
||||
|
||||
var rlsindexer, rlsfilter sql.NullString
|
||||
var rlsindexer, rlsfilter, infoUrl, downloadUrl sql.NullString
|
||||
|
||||
var rasId sql.NullInt64
|
||||
var rasStatus, rasAction, rasType, rasClient, rasFilter sql.NullString
|
||||
var rasRejections []sql.NullString
|
||||
var rasTimestamp sql.NullTime
|
||||
|
||||
if err := rows.Scan(&rls.ID, &rls.FilterStatus, pq.Array(&rls.Rejections), &rlsindexer, &rlsfilter, &rls.Protocol, &rls.Title, &rls.TorrentName, &rls.Size, &rls.Timestamp, &rasId, &rasStatus, &rasAction, &rasType, &rasClient, &rasFilter, pq.Array(&rasRejections), &rasTimestamp, &countItems); err != nil {
|
||||
if err := rows.Scan(&rls.ID, &rls.FilterStatus, pq.Array(&rls.Rejections), &rlsindexer, &rlsfilter, &rls.Protocol, &infoUrl, &downloadUrl, &rls.Title, &rls.TorrentName, &rls.Size, &rls.Timestamp, &rasId, &rasStatus, &rasAction, &rasType, &rasClient, &rasFilter, pq.Array(&rasRejections), &rasTimestamp, &countItems); err != nil {
|
||||
return res, 0, 0, errors.Wrap(err, "error scanning row")
|
||||
}
|
||||
|
||||
|
@ -280,6 +280,8 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
|
|||
rls.Indexer = rlsindexer.String
|
||||
rls.FilterName = rlsfilter.String
|
||||
rls.ActionStatus = make([]domain.ReleaseActionStatus, 0)
|
||||
rls.InfoURL = infoUrl.String
|
||||
rls.TorrentURL = downloadUrl.String
|
||||
|
||||
// only add ActionStatus if it's not empty
|
||||
if ras.ID > 0 {
|
||||
|
|
|
@ -199,6 +199,8 @@ CREATE TABLE "release"
|
|||
protocol TEXT,
|
||||
implementation TEXT,
|
||||
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
info_url TEXT,
|
||||
download_url TEXT,
|
||||
group_id TEXT,
|
||||
torrent_id TEXT,
|
||||
torrent_name TEXT,
|
||||
|
@ -1040,4 +1042,10 @@ UPDATE release_action_status
|
|||
SET filter_id = (SELECT f.id
|
||||
FROM filter f WHERE f.name = release_action_status.filter);
|
||||
`,
|
||||
`ALTER TABLE "release"
|
||||
ADD COLUMN info_url TEXT;
|
||||
|
||||
ALTER TABLE "release"
|
||||
ADD COLUMN download_url TEXT;
|
||||
`,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue