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 available notification methods. |
|
|
Send a failure notification. |
Send a notification when processing was interrupted by the user. |
|
|
Send a notification for partial success (some files converted, some failed/skipped). |
|
Send a success notification. |
|
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.