scraper icon indicating copy to clipboard operation
scraper copied to clipboard

Download videos multiple times for the same game / different regions / version ?

Open zcstrife opened this issue 8 years ago • 1 comments

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?

zcstrife avatar Oct 11 '17 09:10 zcstrife

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?

zcstrife avatar Oct 11 '17 09:10 zcstrife