mkv2cast.notifications

Desktop notification support for mkv2cast.

Sends system notifications when conversions complete. Uses notify-send (libnotify) as primary method with plyer as fallback.

Functions

check_notification_support()

Check available notification methods.

notify_failure(failed_count[, error_summary])

Send a failure notification.

notify_interrupted()

Send a notification when processing was interrupted by the user.

notify_partial(ok_count, failed_count, ...)

Send a notification for partial success (some files converted, some failed/skipped).

notify_success(converted_count, total_time)

Send a success notification.

send_notification(title, message[, urgency, ...])

Send a desktop notification.

mkv2cast.notifications.send_notification(title: str, message: str, urgency: Literal['low', 'normal', 'critical'] = 'normal', icon: str = 'video-x-generic', timeout: int = 10) bool[source]

Send a desktop notification.

Tries notify-send first (Linux standard), then falls back to plyer if available.

Parameters:
  • title – Notification title.

  • message – Notification body text.

  • urgency – Urgency level - “low”, “normal”, or “critical”.

  • icon – Icon name (XDG icon spec) or path.

  • timeout – Notification timeout in seconds.

Returns:

True if notification was sent successfully, False otherwise.

mkv2cast.notifications.notify_success(converted_count: int, total_time: str) bool[source]

Send a success notification.

Parameters:
  • converted_count – Number of files successfully converted.

  • total_time – Total processing time as formatted string.

Returns:

True if notification sent successfully.

mkv2cast.notifications.notify_failure(failed_count: int, error_summary: str | None = None) bool[source]

Send a failure notification.

Parameters:
  • failed_count – Number of files that failed.

  • error_summary – Optional brief error description.

Returns:

True if notification sent successfully.

mkv2cast.notifications.notify_partial(ok_count: int, failed_count: int, skipped_count: int, total_time: str) bool[source]

Send a notification for partial success (some files converted, some failed/skipped).

Parameters:
  • ok_count – Number of successful conversions.

  • failed_count – Number of failed conversions.

  • skipped_count – Number of skipped files.

  • total_time – Total processing time as formatted string.

Returns:

True if notification sent successfully.

mkv2cast.notifications.notify_interrupted() bool[source]

Send a notification when processing was interrupted by the user.

mkv2cast.notifications.check_notification_support() dict[source]

Check available notification methods.

Returns:

Dict with ‘notify_send’ and ‘plyer’ boolean keys indicating availability.