Skip to content

Commit

Permalink
Fix VRHush Trailers (xbapps#1264)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshski authored May 8, 2023
1 parent d907ca8 commit 9adce0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pkg/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,13 @@ func Migrate() {
return tx.Exec(sql).Error
},
},
{
ID: "0062-fix-vrhush-trailers",
Migrate: func(tx *gorm.DB) error {
sql := `update scenes set trailer_source = replace(trailer_source, '"html_element":"web-vr-video-player"', '"html_element":"web-vr-video-player source"') where scene_id like 'vrhush%' and trailer_source like '%"html_element":"web-vr-video-player"%'`
return tx.Exec(sql).Error
},
},
})

if err := m.Migrate(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scrape/vrhush.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func VRHush(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out chan<

// trailer details
sc.TrailerType = "scrape_html"
params := models.TrailerScrape{SceneUrl: sc.HomepageURL, HtmlElement: "web-vr-video-player", ContentPath: "src", QualityPath: "quality", ContentBaseUrl: "https:"}
params := models.TrailerScrape{SceneUrl: sc.HomepageURL, HtmlElement: "web-vr-video-player source", ContentPath: "src", QualityPath: "quality", ContentBaseUrl: "https:"}
strParams, _ := json.Marshal(params)
sc.TrailerSrc = string(strParams)

Expand Down

0 comments on commit 9adce0a

Please sign in to comment.