mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-08 13:44:39 +02:00
Fix some year est issues & add ability for oputil fb scan --update to pick up years
This commit is contained in:
parent
1b414b9b8c
commit
f0b9cd102d
2 changed files with 17 additions and 8 deletions
|
@ -172,8 +172,8 @@ function scanFileAreaForChanges(areaInfo, options, cb) {
|
|||
//
|
||||
// We'll update the entry if the following conditions are met:
|
||||
// * We have a single duplicate, and:
|
||||
// * --update was passed or the existing entry's desc or
|
||||
// longDesc are blank/empty
|
||||
// * --update was passed or the existing entry's desc,
|
||||
// longDesc, or yearEst are blank/empty
|
||||
//
|
||||
if(argv.update && 1 === dupeEntries.length) {
|
||||
const FileEntry = require('../../core/file_entry.js');
|
||||
|
@ -193,15 +193,19 @@ function scanFileAreaForChanges(areaInfo, options, cb) {
|
|||
|
||||
if( tagsEq &&
|
||||
fileEntry.desc === existingEntry.desc &&
|
||||
fileEntry.descLong == existingEntry.descLong)
|
||||
fileEntry.descLong == existingEntry.descLong &&
|
||||
fileEntry.meta.est_release_year == existingEntry.meta.est_release_year)
|
||||
{
|
||||
console.info('Dupe');
|
||||
return nextFile(null);
|
||||
}
|
||||
|
||||
console.info('Dupe (updating)');
|
||||
existingEntry.desc = fileEntry.desc;
|
||||
existingEntry.descLong = fileEntry.descLong;
|
||||
|
||||
// don't allow overwrite of values if new version is blank
|
||||
existingEntry.desc = fileEntry.desc || existingEntry.desc;
|
||||
existingEntry.descLong = fileEntry.descLong || existingEntry.descLong;
|
||||
existingEntry.meta.est_release_year = fileEntry.meta.est_release_year || existingEntry.meta.est_release_year;
|
||||
updateTags(existingEntry);
|
||||
|
||||
finalizeEntryAndPersist(true, existingEntry, descHandler, err => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue