Compare commits

...

16 Commits

Author SHA1 Message Date
advplyr 81640464ba Update cleanDatabase to remove duplicate mediaProgresses 2025-06-06 17:05:07 -05:00
advplyr e669a8d378 Merge pull request #4370 from Vito0912/feat/MaxFailedEpisodeChecks-
Adds ENV for MaxFailedEpisodeChecks
2025-06-05 15:06:27 -05:00
advplyr 8e01859075 Cast PODCAST_DOWNLOAD_TIMEOUT and MAX_FAILED_EPISODE_CHECKS env vars to numbers 2025-06-05 14:31:12 -05:00
Vito0912 84c9c6cb50 move to global 2025-06-05 14:07:35 +02:00
advplyr 704c6f7bde Merge pull request #4374 from Vito0912/feat/allowBase64Images
Corrects removing of attachments for Trix
2025-06-04 16:36:46 -05:00
advplyr f01055f6e6 Merge pull request #4373 from Vito0912/feat/maybeFixPodcast
Potential fix/new knowledge for hangig podcasts
2025-06-04 16:33:40 -05:00
Vito0912 759c58d3f7 remove any attachment 2025-06-04 16:38:01 +02:00
Vito0912 357176b301 catch timeout 2025-06-04 16:15:18 +02:00
Vito0912 9bb4dc3ab0 potential fix 2025-06-04 10:58:44 +02:00
Vito0912 709c33f27a ensure proper type 2025-06-04 10:05:16 +02:00
Vito0912 4d846e225a Adds ENV for MaxFailedEpisodeChecks 2025-06-04 10:02:17 +02:00
advplyr 5dc6d613bd Merge pull request #4361 from Vito0912/feat/encoderSettings
Fix: Audiobook m4b advanced encoder ignore
2025-06-02 16:53:28 -05:00
advplyr 63ccdb68f0 Fix m4b encoder backup file overwriting the encoded file when they have the same filename 2025-06-02 16:50:03 -05:00
Vito0912 424ef1aec3 prettier 2 2025-06-02 19:34:25 +02:00
Vito0912 b6995ba5d1 prettier 2025-06-02 19:33:50 +02:00
Vito0912 9968743a93 fix wrong display and ignored values 2025-06-02 19:32:52 +02:00
9 changed files with 52 additions and 20 deletions
+2 -4
View File
@@ -318,10 +318,8 @@ export default {
}
},
handleAttachmentAdd(event) {
// Prevent pasting in images from the browser
if (!event.attachment.file) {
event.attachment.remove()
}
// Prevent pasting in images/any files from the browser
event.attachment.remove()
}
},
mounted() {
@@ -143,10 +143,18 @@ export default {
localStorage.setItem('embedMetadataCodec', val)
},
getEncodingOptions() {
return {
codec: this.selectedCodec || 'aac',
bitrate: this.selectedBitrate || '128k',
channels: this.selectedChannels || 2
if (this.showAdvancedView) {
return {
codec: this.customCodec || this.selectedCodec || 'aac',
bitrate: this.customBitrate || this.selectedBitrate || '128k',
channels: this.customChannels || this.selectedChannels || 2
}
} else {
return {
codec: this.selectedCodec || 'aac',
bitrate: this.selectedBitrate || '128k',
channels: this.selectedChannels || 2
}
}
},
setPreset() {
+1 -1
View File
@@ -248,4 +248,4 @@ export default {
transform: scale(0);
}
}
</style>
</style>
@@ -109,4 +109,4 @@ export default {
}
}
}
</script>
</script>
+2
View File
@@ -356,6 +356,8 @@ export default {
const encodeOptions = this.$refs.encoderOptionsCard.getEncodingOptions()
this.encodingOptions = encodeOptions
const queryParams = new URLSearchParams(encodeOptions)
this.processing = true
+9
View File
@@ -765,6 +765,15 @@ class Database {
if (badSessionsRemoved > 0) {
Logger.warn(`Removed ${badSessionsRemoved} sessions that were 3 seconds or less`)
}
// Remove mediaProgresses with duplicate mediaItemId (remove the oldest updatedAt)
const [duplicateMediaProgresses] = await this.sequelize.query(`SELECT id, mediaItemId FROM mediaProgresses WHERE (mediaItemId, updatedAt) IN (SELECT mediaItemId, MIN(updatedAt) FROM mediaProgresses GROUP BY mediaItemId HAVING COUNT(*) > 1)`)
for (const duplicateMediaProgress of duplicateMediaProgresses) {
Logger.warn(`Found duplicate mediaProgress for mediaItem "${duplicateMediaProgress.mediaItemId}" - removing it`)
await this.mediaProgressModel.destroy({
where: { id: duplicateMediaProgress.id }
})
}
}
async createTextSearchQuery(query) {
+3 -6
View File
@@ -12,6 +12,7 @@ const { version } = require('../package.json')
// Utils
const fileUtils = require('./utils/fileUtils')
const { toNumber } = require('./utils/index')
const Logger = require('./Logger')
const Auth = require('./Auth')
@@ -84,12 +85,8 @@ class Server {
global.DisableSsrfRequestFilter = (url) => whitelistedUrls.includes(new URL(url).hostname)
}
}
if (process.env.PODCAST_DOWNLOAD_TIMEOUT) {
global.PodcastDownloadTimeout = process.env.PODCAST_DOWNLOAD_TIMEOUT
} else {
global.PodcastDownloadTimeout = 30000
}
global.PodcastDownloadTimeout = toNumber(process.env.PODCAST_DOWNLOAD_TIMEOUT, 30000)
global.MaxFailedEpisodeChecks = toNumber(process.env.MAX_FAILED_EPISODE_CHECKS, 24)
if (!fs.pathExistsSync(global.ConfigPath)) {
fs.mkdirSync(global.ConfigPath)
+9 -1
View File
@@ -203,7 +203,15 @@ class AbMergeManager {
// Move library item tracks to cache
for (const [index, trackPath] of task.data.originalTrackPaths.entries()) {
const trackFilename = Path.basename(trackPath)
const moveToPath = Path.join(task.data.itemCachePath, trackFilename)
let moveToPath = Path.join(task.data.itemCachePath, trackFilename)
// If the track is the same as the temp file, we need to rename it to avoid overwriting it
if (task.data.tempFilepath === moveToPath) {
const trackExtname = Path.extname(task.data.tempFilepath)
const newTrackFilename = Path.basename(task.data.tempFilepath, trackExtname) + '.backup' + trackExtname
moveToPath = Path.join(task.data.itemCachePath, newTrackFilename)
}
Logger.debug(`[AbMergeManager] Backing up original track "${trackPath}" to ${moveToPath}`)
if (index === 0) {
// copy the first track to the cache directory
+13 -3
View File
@@ -30,7 +30,7 @@ class PodcastManager {
this.currentDownload = null
this.failedCheckMap = {}
this.MaxFailedEpisodeChecks = 24
this.MaxFailedEpisodeChecks = global.MaxFailedEpisodeChecks
}
getEpisodeDownloadsInQueue(libraryItemId) {
@@ -345,7 +345,7 @@ class PodcastManager {
// Allow up to MaxFailedEpisodeChecks failed attempts before disabling auto download
if (!this.failedCheckMap[libraryItem.id]) this.failedCheckMap[libraryItem.id] = 0
this.failedCheckMap[libraryItem.id]++
if (this.failedCheckMap[libraryItem.id] >= this.MaxFailedEpisodeChecks) {
if (this.MaxFailedEpisodeChecks !== 0 && this.failedCheckMap[libraryItem.id] >= this.MaxFailedEpisodeChecks) {
Logger.error(`[PodcastManager] runEpisodeCheck ${this.failedCheckMap[libraryItem.id]} failed attempts at checking episodes for "${libraryItem.media.title}" - disabling auto download`)
libraryItem.media.autoDownloadEpisodes = false
delete this.failedCheckMap[libraryItem.id]
@@ -384,7 +384,17 @@ class PodcastManager {
Logger.error(`[PodcastManager] checkPodcastForNewEpisodes no feed url for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id})`)
return null
}
const feed = await getPodcastFeed(podcastLibraryItem.media.feedURL)
const feed = await Promise.race([
getPodcastFeed(podcastLibraryItem.media.feedURL),
new Promise((_, reject) =>
// The added second is to make sure that axios can fail first and only falls back later
setTimeout(() => reject(new Error('Timeout. getPodcastFeed seemed to timeout but not triggering the timeout.')), global.PodcastDownloadTimeout + 1000)
)
]).catch((error) => {
Logger.error(`[PodcastManager] checkPodcastForNewEpisodes failed to fetch feed for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id}):`, error)
return null
})
if (!feed?.episodes) {
Logger.error(`[PodcastManager] checkPodcastForNewEpisodes invalid feed payload for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id})`, feed)
return null