Skip to content

Commit

Permalink
Fix: VirtualPorn migration (#1691)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshski authored Apr 5, 2024
1 parent 20ca993 commit 8e47a65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1941,8 +1941,8 @@ func Migrate() {
{
ID: "0077-Update-VirtualPorn-ids",
Migrate: func(tx *gorm.DB) error {
err := scrape.UpdateVirtualPornIds()
return err
scrape.UpdateVirtualPornIds()
return nil
},
},
})
Expand Down
9 changes: 3 additions & 6 deletions pkg/scrape/virtualporn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package scrape

import (
"encoding/json"
"errors"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -177,7 +176,7 @@ func init() {
}

// one off conversion routine called by migrations.go
func UpdateVirtualPornIds() error {
func UpdateVirtualPornIds() {
collector := createCollector("virtualporn.com")
apiCollector := createCollector("site-api.project1service.com")
offset := 0
Expand Down Expand Up @@ -245,10 +244,8 @@ func UpdateVirtualPornIds() error {

collector.Visit("https://virtualporn.com/videos")

if sceneCnt > 0 {
return nil
} else {
return errors.New("No scenes updated")
if sceneCnt == 0 {
log.Info("Unable to access VirtualPorn scenes, existing scenes could not be upgraded with new Scene Ids")
}

}

0 comments on commit 8e47a65

Please sign in to comment.