mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-26 13:51:16 +02:00
fixed Unit-Test and added void for to async methods
This commit is contained in:
parent
dc41ccc377
commit
64fa48981e
@ -43,7 +43,7 @@ class NotificationManager {
|
||||
episodeSubtitle: episode.subtitle || '',
|
||||
episodeDescription: episode.description || ''
|
||||
}
|
||||
this.triggerNotification('onPodcastEpisodeDownloaded', eventData)
|
||||
void this.triggerNotification('onPodcastEpisodeDownloaded', eventData)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ class NotificationManager {
|
||||
backupCount: totalBackupCount || 'Invalid',
|
||||
removedOldest: removedOldest || 'false'
|
||||
}
|
||||
this.triggerNotification('onBackupCompleted', eventData)
|
||||
void this.triggerNotification('onBackupCompleted', eventData)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,11 +87,11 @@ class NotificationManager {
|
||||
const eventData = {
|
||||
errorMsg: errorMsg || 'Backup failed'
|
||||
}
|
||||
this.triggerNotification('onBackupFailed', eventData)
|
||||
void this.triggerNotification('onBackupFailed', eventData)
|
||||
}
|
||||
|
||||
onTest() {
|
||||
this.triggerNotification('onTest')
|
||||
void this.triggerNotification('onTest')
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,7 +157,7 @@ class NotificationManager {
|
||||
if (this.notificationQueue.length) {
|
||||
// Send next notification in queue
|
||||
const nextNotificationEvent = this.notificationQueue.shift()
|
||||
this.triggerNotification(nextNotificationEvent.eventName, nextNotificationEvent.eventData)
|
||||
void this.triggerNotification(nextNotificationEvent.eventName, nextNotificationEvent.eventData)
|
||||
}
|
||||
}, Database.notificationSettings.notificationDelay)
|
||||
}
|
||||
@ -187,14 +187,14 @@ class NotificationManager {
|
||||
}
|
||||
|
||||
fireNotificationFromSocket(eventName, eventData) {
|
||||
if (!Database.notificationSettings.isUseable) return
|
||||
if (!Database.notificationSettings || !Database.notificationSettings.isUseable) return
|
||||
|
||||
const eventNameModified = eventName.replace(/_([a-z])/g, (_, c) => c.toUpperCase())
|
||||
const eventKey = `on${eventNameModified.charAt(0).toUpperCase()}${eventNameModified.slice(1)}`
|
||||
|
||||
if (!Database.notificationSettings.getHasActiveNotificationsForEvent(eventKey)) {
|
||||
// No logging to prevent console spam
|
||||
Logger.debug(`[NotificationManager] fireSocketNotification: No active notifications`)
|
||||
//Logger.debug(`[NotificationManager] fireSocketNotification: No active notifications`)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user