mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 11:39:46 +08:00
feat: download movie every 1h
This commit is contained in:
@@ -84,8 +84,6 @@ var (
|
||||
DefaultCreatedAt time.Time
|
||||
// DefaultAirDate holds the default value on creation for the "air_date" field.
|
||||
DefaultAirDate string
|
||||
// DefaultResolution holds the default value on creation for the "resolution" field.
|
||||
DefaultResolution string
|
||||
)
|
||||
|
||||
// MediaType defines the type for the "media_type" enum field.
|
||||
@@ -111,6 +109,33 @@ func MediaTypeValidator(mt MediaType) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Resolution defines the type for the "resolution" enum field.
|
||||
type Resolution string
|
||||
|
||||
// Resolution1080p is the default value of the Resolution enum.
|
||||
const DefaultResolution = Resolution1080p
|
||||
|
||||
// Resolution values.
|
||||
const (
|
||||
Resolution720p Resolution = "720p"
|
||||
Resolution1080p Resolution = "1080p"
|
||||
Resolution4k Resolution = "4k"
|
||||
)
|
||||
|
||||
func (r Resolution) String() string {
|
||||
return string(r)
|
||||
}
|
||||
|
||||
// ResolutionValidator is a validator for the "resolution" field enum values. It is called by the builders before save.
|
||||
func ResolutionValidator(r Resolution) error {
|
||||
switch r {
|
||||
case Resolution720p, Resolution1080p, Resolution4k:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("media: invalid enum value for resolution field: %q", r)
|
||||
}
|
||||
}
|
||||
|
||||
// OrderOption defines the ordering options for the Media queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
|
||||
@@ -95,11 +95,6 @@ func AirDate(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldEQ(FieldAirDate, v))
|
||||
}
|
||||
|
||||
// Resolution applies equality check predicate on the "resolution" field. It's identical to ResolutionEQ.
|
||||
func Resolution(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldEQ(FieldResolution, v))
|
||||
}
|
||||
|
||||
// StorageID applies equality check predicate on the "storage_id" field. It's identical to StorageIDEQ.
|
||||
func StorageID(v int) predicate.Media {
|
||||
return predicate.Media(sql.FieldEQ(FieldStorageID, v))
|
||||
@@ -611,70 +606,25 @@ func AirDateContainsFold(v string) predicate.Media {
|
||||
}
|
||||
|
||||
// ResolutionEQ applies the EQ predicate on the "resolution" field.
|
||||
func ResolutionEQ(v string) predicate.Media {
|
||||
func ResolutionEQ(v Resolution) predicate.Media {
|
||||
return predicate.Media(sql.FieldEQ(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionNEQ applies the NEQ predicate on the "resolution" field.
|
||||
func ResolutionNEQ(v string) predicate.Media {
|
||||
func ResolutionNEQ(v Resolution) predicate.Media {
|
||||
return predicate.Media(sql.FieldNEQ(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionIn applies the In predicate on the "resolution" field.
|
||||
func ResolutionIn(vs ...string) predicate.Media {
|
||||
func ResolutionIn(vs ...Resolution) predicate.Media {
|
||||
return predicate.Media(sql.FieldIn(FieldResolution, vs...))
|
||||
}
|
||||
|
||||
// ResolutionNotIn applies the NotIn predicate on the "resolution" field.
|
||||
func ResolutionNotIn(vs ...string) predicate.Media {
|
||||
func ResolutionNotIn(vs ...Resolution) predicate.Media {
|
||||
return predicate.Media(sql.FieldNotIn(FieldResolution, vs...))
|
||||
}
|
||||
|
||||
// ResolutionGT applies the GT predicate on the "resolution" field.
|
||||
func ResolutionGT(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldGT(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionGTE applies the GTE predicate on the "resolution" field.
|
||||
func ResolutionGTE(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldGTE(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionLT applies the LT predicate on the "resolution" field.
|
||||
func ResolutionLT(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldLT(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionLTE applies the LTE predicate on the "resolution" field.
|
||||
func ResolutionLTE(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldLTE(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionContains applies the Contains predicate on the "resolution" field.
|
||||
func ResolutionContains(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldContains(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionHasPrefix applies the HasPrefix predicate on the "resolution" field.
|
||||
func ResolutionHasPrefix(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldHasPrefix(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionHasSuffix applies the HasSuffix predicate on the "resolution" field.
|
||||
func ResolutionHasSuffix(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldHasSuffix(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionEqualFold applies the EqualFold predicate on the "resolution" field.
|
||||
func ResolutionEqualFold(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldEqualFold(FieldResolution, v))
|
||||
}
|
||||
|
||||
// ResolutionContainsFold applies the ContainsFold predicate on the "resolution" field.
|
||||
func ResolutionContainsFold(v string) predicate.Media {
|
||||
return predicate.Media(sql.FieldContainsFold(FieldResolution, v))
|
||||
}
|
||||
|
||||
// StorageIDEQ applies the EQ predicate on the "storage_id" field.
|
||||
func StorageIDEQ(v int) predicate.Media {
|
||||
return predicate.Media(sql.FieldEQ(FieldStorageID, v))
|
||||
|
||||
Reference in New Issue
Block a user