scraper
scraper copied to clipboard
Download videos multiple times for the same game / different regions / version ?
Hi,
Would it be possible to prevent the script to download a video preview multiple times for the same game. It takes a lot of space for nothing. I guess what you would need would be to add this condition: if video preview for "file name" already exist for "rom name", then use the same existing video. Right?
Or maybe just call the videos by their "prettyname": iName := prettyName + opts.VidSuffix
type ROM struct {
Path string
Dir string
BaseName string
FileName string
PrettyName string
Ext string
Bins []string
Cue bool
Game *ds.Game
NotFound bool
}
// GetGame attempts to populates the Game from data sources in oder.
func (r *ROM) GetGame(ctx context.Context, data []ds.DS, opts *GameOpts) error {
(...)
r.Game = game
r.PrettyName = prettyName
return nil
}
// getVidPath gets the path to use for video.
func getVidPath(r *ROM, opts *XMLOpts) string {
var vidPath string
if opts.NestImgDir {
dir := strings.TrimPrefix(r.Dir, opts.RomDir)
vidPath = filepath.Join(opts.VidDir, dir)
} else {
vidPath = opts.VidDir
}
iName := r.PrettyName + opts.VidSuffix
return filepath.Join(vidPath, iName)
}
How could this work?