@@ -115,25 +115,37 @@ export default class MetadataManager {
115115 }
116116
117117 async matchAllMetadata ( fuzzy = false ) {
118- let games = await File . findAll ( {
119- where : {
120- nongame : false ,
121- detailsId : null ,
122- } ,
123- attributes : [ "id" , "filename" , "category" ] ,
124- order : [ "id" , "filename" ] ,
125- include : { model : Metadata , as : "details" } ,
126- } ) ;
118+ let games = [ ] ;
119+ if ( process . env . FORCE_METADATA_RESYNC == "1" ) {
120+ games = await File . findAll ( {
121+ where : {
122+ nongame : false ,
123+ } ,
124+ attributes : [ "id" , "filename" , "category" ] ,
125+ order : [ "id" , "filename" ] ,
126+ include : { model : Metadata , as : "details" } ,
127+ } ) ;
128+ } else {
129+ games = await File . findAll ( {
130+ where : {
131+ nongame : false ,
132+ detailsId : null ,
133+ } ,
134+ attributes : [ "id" , "filename" , "category" ] ,
135+ order : [ "id" , "filename" ] ,
136+ include : { model : Metadata , as : "details" } ,
137+ } ) ;
138+ }
139+
127140 let count = games . length ;
128141 let timer = new Timer ( ) ;
129142 let found = 0 ;
130143 console . log ( `Matching ${ count } games to metadata.` ) ;
131144 for ( let x = 0 ; x < count ; x ++ ) {
132145 singleLineStatus (
133- `Matching metadata: ${ x } / ${ count } ${ (
134- ( ( x ) / count ) *
135- 100
136- ) . toFixed ( 2 ) } % (${ timer . elapsed ( ) } ) Total Matches: ${ found } `
146+ `Matching metadata: ${ x } / ${ count } ${ ( ( x / count ) * 100 ) . toFixed (
147+ 2
148+ ) } % (${ timer . elapsed ( ) } ) Total Matches: ${ found } `
137149 ) ;
138150 let game = games [ x ] ;
139151 let metadata = await Metadata . searchByText (
0 commit comments