Skip to content

Commit

Permalink
Strip nulls on ingest of the titleDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralim committed Sep 18, 2022
1 parent aa6d949 commit b048f73
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions titledb/titledb.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package titledb

import (
"bytes"
"encoding/json"
"fmt"
"io"
Expand Down Expand Up @@ -84,6 +85,8 @@ func (db *TitlesDB) downloadFileAndInjest(fileURL string, wg *sync.WaitGroup) {
func (db *TitlesDB) injestTitleDBFile(path string) error {
//Load json from the titlesDB file
fileContents, err := os.ReadFile(path)
//Strip nulls
fileContents = bytes.Replace(fileContents, []byte{'\x00'}, []byte{}, -1)
if err != nil {
return fmt.Errorf("failed to load the Titledb - %w", err)
}
Expand Down

0 comments on commit b048f73

Please sign in to comment.