mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-18 22:58:29 +01:00
Add:Podcast auto-download option to delete an episode if it exceeds X max episodes to keep #903
This commit is contained in:
1 parent
2c0c53bbf1
commit
7a69afdcd9
6 files changed
+85
-14
No files matched your search
@@ -16,7 +16,7 @@ async function getFileStat(path) {
|
||||
birthtime: stat.birthtime
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to stat', err)
|
||||
Logger.error('[fileUtils] Failed to stat', err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ async function getFileTimestampsWithIno(path) {
|
||||
ino: String(stat.ino)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to getFileTimestampsWithIno', err)
|
||||
Logger.error('[fileUtils] Failed to getFileTimestampsWithIno', err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -219,4 +219,12 @@ module.exports.getAudioMimeTypeFromExtname = (extname) => {
|
||||
const formatUpper = extname.slice(1).toUpperCase()
|
||||
if (AudioMimeType[formatUpper]) return AudioMimeType[formatUpper]
|
||||
return null
|
||||
}
|
||||
|
||||
module.exports.removeFile = (path) => {
|
||||
if (!path) return false
|
||||
return fs.remove(path).then(() => true).catch((error) => {
|
||||
Logger.error(`[fileUtils] Failed remove file "${path}"`, error)
|
||||
return false
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user