You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Filters (Cast, Studio, Tags,...) can now be switched to "must have" and "must not have" states (#1008)
* Must Include & Exclude optionsfor scene filtering
* Add Tag Tooltips
Remove Db Debug used in testing
* Updated filters UI
Co-authored-by: crwxaj <[email protected]>
Joins("left join scene_tags on scene_tags.scene_id=scenes.id").
559
582
Joins("left join tags on tags.id=scene_tags.tag_id").
560
583
Where("tags.name IN (?)", tags)
561
584
}
585
+
foridx, musthave:=rangemustHaveTags {
586
+
stAlias:="st_i"+strconv.Itoa(idx)
587
+
tagAlias:="t_i"+strconv.Itoa(idx)
588
+
tx=tx.
589
+
Joins("join scene_tags "+stAlias+" on "+stAlias+".scene_id=scenes.id").
590
+
Joins("join tags "+tagAlias+" on "+tagAlias+".id="+stAlias+".tag_id and "+tagAlias+".name=?", musthave)
591
+
}
592
+
foridx, exclude:=rangeexcludedTags {
593
+
stAlias:="st_e"+strconv.Itoa(idx)
594
+
tagAlias:="t_e"+strconv.Itoa(idx)
595
+
tx=tx.Where("scenes.id not in (select "+stAlias+".scene_id from tags "+tagAlias+" join scene_tags "+stAlias+" on "+stAlias+".scene_id =scenes.id and "+tagAlias+".id ="+stAlias+".tag_id where "+tagAlias+".name =?)", exclude)
Joins("left join scene_cast on scene_cast.scene_id=scenes.id").
570
616
Joins("left join actors on actors.id=scene_cast.actor_id").
571
617
Where("actors.name IN (?)", cast)
572
618
}
619
+
foridx, musthave:=rangemustHaveCast {
620
+
scAlias:="sc_i"+strconv.Itoa(idx)
621
+
actorAlias:="a_i"+strconv.Itoa(idx)
622
+
tx=tx.
623
+
Joins("join scene_cast "+scAlias+" on "+scAlias+".scene_id=scenes.id").
624
+
Joins("join actors "+actorAlias+" on "+actorAlias+".id="+scAlias+".actor_id and "+actorAlias+".name=?", musthave)
625
+
}
626
+
foridx, exclude:=rangeexcludedCast {
627
+
scAlias:="sc_e"+strconv.Itoa(idx)
628
+
actorAlias:="a_e"+strconv.Itoa(idx)
629
+
tx=tx.Where("scenes.id not in (select "+scAlias+".scene_id from actors "+actorAlias+" join scene_cast "+scAlias+" on "+scAlias+".scene_id =scenes.id and "+actorAlias+".id ="+scAlias+".actor_id where "+actorAlias+".name =?)", exclude)
tx=tx.Joins("left join scene_cuepoints on scene_cuepoints.scene_id=scenes.id")
580
-
for_, i:=rangecuepoint {
581
-
tx=tx.Where("scene_cuepoints.name LIKE ?", "%"+i+"%")
650
+
varwherestring
651
+
foridx, i:=rangecuepoint {
652
+
ifidx==0 {
653
+
where="scene_cuepoints.name LIKE '%"+i+"%'"
654
+
} else {
655
+
where=where+" or scene_cuepoints.name LIKE '%"+i+"%'"
656
+
}
582
657
}
658
+
tx=tx.Where(where)
659
+
}
660
+
foridx, musthave:=rangemustHaveCuepoint {
661
+
scpAlias:="scp_i"+strconv.Itoa(idx)
662
+
tx=tx.
663
+
Joins("join scene_cuepoints "+scpAlias+" on "+scpAlias+".scene_id=scenes.id and "+scpAlias+".name like ?", "%"+musthave+"%")
664
+
}
665
+
foridx, exclude:=rangeexcludedCuepoint {
666
+
scpAlias:="scp_e"+strconv.Itoa(idx)
667
+
tx=tx.Where("scenes.id not in (select "+scpAlias+".scene_id from scene_cuepoints "+scpAlias+" where "+scpAlias+".scene_id =scenes.id and "+scpAlias+".name like ?)", "%"+exclude+"%")
0 commit comments