2024-07-19 08:03:35 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2024-08-09 19:37:54 +00:00
|
|
|
type (
|
2024-08-10 22:13:46 +00:00
|
|
|
UserID string
|
|
|
|
PostID string
|
|
|
|
PostURL string
|
|
|
|
|
|
|
|
SourceID string
|
|
|
|
SourceDomain string
|
|
|
|
|
|
|
|
TagName string
|
|
|
|
TagGroupName string
|
|
|
|
TagAliasName string
|
|
|
|
|
2024-08-09 19:37:54 +00:00
|
|
|
ScrapeTimeInterval int
|
|
|
|
UserLastScrapeTime time.Time
|
2024-07-19 08:03:35 +00:00
|
|
|
|
2024-08-09 19:37:54 +00:00
|
|
|
Rating string
|
|
|
|
TagType string
|
|
|
|
|
|
|
|
UserSourceID string
|
|
|
|
UserFavoriteID string
|
|
|
|
)
|
2024-07-19 08:03:35 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
SFW Rating = "safe"
|
|
|
|
NSFW Rating = "explicit"
|
|
|
|
Questionable Rating = "questionable"
|
|
|
|
Unknown Rating = "unknown"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
General TagType = "general"
|
|
|
|
Species TagType = "species"
|
|
|
|
Character TagType = "character"
|
|
|
|
Artist TagType = "artist"
|
|
|
|
Lore TagType = "lore"
|
|
|
|
Meta TagType = "meta"
|
|
|
|
Invalid TagType = "invalid"
|
|
|
|
Copyright TagType = "copyright"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (r *Rating) Convert(e621Rating string) {
|
|
|
|
switch e621Rating {
|
|
|
|
case "e":
|
|
|
|
*r = NSFW
|
|
|
|
case "q":
|
|
|
|
*r = Questionable
|
|
|
|
case "s":
|
|
|
|
*r = SFW
|
|
|
|
default:
|
|
|
|
*r = Unknown
|
|
|
|
}
|
|
|
|
}
|