func migrateVttFile(vttPath, oldSpritePath, newSpritePath string) {
	contents, err := ioutil.ReadFile(vttPath)
	if err != nil {
		logger.Errorf("Error reading %s for vtt migration: %v", vttPath, err)
		return
	}

	oldSpriteBasename := filepath.Base(oldSpritePath)
	newSpriteBasename := filepath.Base(newSpritePath)

	contents = bytes.ReplaceAll(contents, []byte(oldSpriteBasename), []byte(newSpriteBasename))

	if err := ioutil.WriteFile(vttPath, contents, 0644); err != nil {
		logger.Errorf("Error writing %s for vtt migration: %v", vttPath, err)
		return
	}
}
// #2481: migrate vtt file contents in addition to renaming
#2481: migrate vtt file contents in addition to renaming
// #2481 : migrate vtt file contents in addition to renaming
func migrateVttFile(vttPath, oldSpritePath, newSpritePath string) {
	contents, err := ioutil.ReadFile(vttPath)
	if err != nil {
		logger.Errorf("Error reading %s for vtt migration: %v", vttPath, err)
		return
	}
	oldSpriteBasename := filepath.Base(oldSpritePath)
	newSpriteBasename := filepath.Base(newSpritePath)
	contents = bytes.ReplaceAll(contents, []byte(oldSpriteBasename), []byte(newSpriteBasename))
	if err := ioutil.WriteFile(vttPath, contents, 0644); err != nil {
		logger.Errorf("Error writing %s for vtt migration: %v", vttPath, err)
		return
	}
}
func migrateVttFile ( vttPath , oldSpritePath , newSpritePath string ) { contents , err := ioutil . ReadFile ( vttPath ) if err != nil { logger . Errorf ( " " , vttPath , err ) return } oldSpriteBasename := filepath . Base ( oldSpritePath ) newSpriteBasename := filepath . Base ( newSpritePath ) contents = bytes . ReplaceAll ( contents , [ ] byte ( oldSpriteBasename ) , [ ] byte ( newSpriteBasename ) ) if err := ioutil . WriteFile ( vttPath , contents , 0644 ) ; err != nil { logger . Errorf ( " " , vttPath , err ) return } }
2481: migrate vtt file contents in addition to renaming
2481 : migrate vtt file contents in addition to renaming