feat: save torrent link to history

This commit is contained in:
Simon Ding
2024-10-09 23:56:04 +08:00
parent 6527f843d8
commit 7e4d907ef6
14 changed files with 838 additions and 6 deletions

View File

@@ -29,6 +29,8 @@ const (
FieldDownloadClientID = "download_client_id"
// FieldIndexerID holds the string denoting the indexer_id field in the database.
FieldIndexerID = "indexer_id"
// FieldLink holds the string denoting the link field in the database.
FieldLink = "link"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldSaved holds the string denoting the saved field in the database.
@@ -48,6 +50,7 @@ var Columns = []string{
FieldSize,
FieldDownloadClientID,
FieldIndexerID,
FieldLink,
FieldStatus,
FieldSaved,
}
@@ -141,6 +144,11 @@ func ByIndexerID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIndexerID, opts...).ToFunc()
}
// ByLink orders the results by the link field.
func ByLink(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLink, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()