e8774abf21
When in a user page and clicked on more torrents, show a list navigable of the user torrent On that list, we can make advance search (categories, order, ...) Moderation search reimplemented Clicking on user (id) in the torrent list redirect to the list of the user torrents Ability to search within the user torrents
48 lignes
592 o
Go
48 lignes
592 o
Go
package common
|
|
|
|
import "strconv"
|
|
|
|
type Status uint8
|
|
|
|
const (
|
|
ShowAll Status = iota
|
|
FilterRemakes
|
|
Trusted
|
|
APlus
|
|
)
|
|
|
|
type SortMode uint8
|
|
|
|
const (
|
|
ID SortMode = iota
|
|
Name
|
|
Date
|
|
Downloads
|
|
Size
|
|
)
|
|
|
|
type Category struct {
|
|
Main, Sub uint8
|
|
}
|
|
|
|
func (c Category) String() (s string) {
|
|
if c.Main != 0 {
|
|
s += strconv.Itoa(int(c.Main))
|
|
}
|
|
s += "_"
|
|
if c.Sub != 0 {
|
|
s += strconv.Itoa(int(c.Sub))
|
|
}
|
|
return
|
|
}
|
|
|
|
type SearchParam struct {
|
|
Order bool // True means acsending
|
|
Status Status
|
|
Sort SortMode
|
|
Category Category
|
|
Page int
|
|
UserID uint
|
|
Max uint
|
|
Query string
|
|
}
|