qBitrr2 5.4.3__tar.gz → 5.4.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. {qbitrr2-5.4.3/qBitrr2.egg-info → qbitrr2-5.4.5}/PKG-INFO +223 -18
  2. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/README.md +222 -17
  3. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/pyproject.toml +1 -1
  4. qbitrr2-5.4.5/qBitrr/auto_update.py +382 -0
  5. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/bundled_data.py +2 -2
  6. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/main.py +44 -5
  7. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/LogsView.js +18 -18
  8. qbitrr2-5.4.5/qBitrr/static/assets/LogsView.js.map +1 -0
  9. qbitrr2-5.4.5/qBitrr/static/assets/app.js +11 -0
  10. qbitrr2-5.4.5/qBitrr/static/assets/app.js.map +1 -0
  11. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/versioning.py +35 -2
  12. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/webui.py +82 -0
  13. {qbitrr2-5.4.3 → qbitrr2-5.4.5/qBitrr2.egg-info}/PKG-INFO +223 -18
  14. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/setup.cfg +1 -1
  15. qbitrr2-5.4.3/qBitrr/auto_update.py +0 -128
  16. qbitrr2-5.4.3/qBitrr/static/assets/LogsView.js.map +0 -1
  17. qbitrr2-5.4.3/qBitrr/static/assets/app.js +0 -11
  18. qbitrr2-5.4.3/qBitrr/static/assets/app.js.map +0 -1
  19. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/LICENSE +0 -0
  20. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/MANIFEST.in +0 -0
  21. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/config.example.toml +0 -0
  22. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/__init__.py +0 -0
  23. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/arss.py +0 -0
  24. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/config.py +0 -0
  25. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/db_lock.py +0 -0
  26. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/env_config.py +0 -0
  27. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/errors.py +0 -0
  28. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/ffprobe.py +0 -0
  29. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/gen_config.py +0 -0
  30. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/home_path.py +0 -0
  31. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/logger.py +0 -0
  32. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/search_activity_store.py +0 -0
  33. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/ArrView.js +0 -0
  34. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/ArrView.js.map +0 -0
  35. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/ConfigView.js +0 -0
  36. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/ConfigView.js.map +0 -0
  37. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/ProcessesView.js +0 -0
  38. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/ProcessesView.js.map +0 -0
  39. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/app.css +0 -0
  40. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/build.svg +0 -0
  41. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/check-mark.svg +0 -0
  42. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/close.svg +0 -0
  43. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/download.svg +0 -0
  44. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/gear.svg +0 -0
  45. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/lidarr.svg +0 -0
  46. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/live-streaming.svg +0 -0
  47. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/log.svg +0 -0
  48. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/plus.svg +0 -0
  49. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/process.svg +0 -0
  50. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/react-select.esm.js +0 -0
  51. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/react-select.esm.js.map +0 -0
  52. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/refresh-arrow.svg +0 -0
  53. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/table.js +0 -0
  54. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/table.js.map +0 -0
  55. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/trash.svg +0 -0
  56. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/up-arrow.svg +0 -0
  57. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/useInterval.js +0 -0
  58. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/useInterval.js.map +0 -0
  59. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/vendor.js +0 -0
  60. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/vendor.js.map +0 -0
  61. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/assets/visibility.svg +0 -0
  62. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/index.html +0 -0
  63. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/manifest.json +0 -0
  64. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/sw.js +0 -0
  65. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/static/vite.svg +0 -0
  66. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/tables.py +0 -0
  67. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr/utils.py +0 -0
  68. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr2.egg-info/SOURCES.txt +0 -0
  69. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr2.egg-info/dependency_links.txt +0 -0
  70. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr2.egg-info/entry_points.txt +0 -0
  71. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr2.egg-info/requires.txt +0 -0
  72. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/qBitrr2.egg-info/top_level.txt +0 -0
  73. {qbitrr2-5.4.3 → qbitrr2-5.4.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qBitrr2
3
- Version: 5.4.3
3
+ Version: 5.4.5
4
4
  Summary: Intelligent automation for qBittorrent and *Arr apps (Radarr/Sonarr/Lidarr) - health monitoring, instant imports, quality upgrades, request integration
5
5
  Home-page: https://github.com/Feramance/qBitrr
6
6
  Author: Feramance
@@ -160,8 +160,11 @@ qBitrr is the intelligent glue between qBittorrent and the *Arr ecosystem (Radar
160
160
  - **Path-specific monitoring** – watch specific directories for space issues
161
161
 
162
162
  ### 🔄 Auto-Updates & Self-Healing
163
+ - **GitHub release-based updates** – automatically checks for published (non-draft) releases via GitHub API
163
164
  - **Scheduled auto-updates** – update qBitrr on a cron schedule (default: weekly Sunday 3 AM)
164
165
  - **Manual update trigger** – one-click updates from WebUI
166
+ - **Installation-aware updates** – detects git/pip/binary installs and uses appropriate update method
167
+ - **Version verification** – confirms installed version matches target before restart
165
168
  - **Smart restart mechanism** – uses `os.execv()` for true in-place restarts (no supervisor needed)
166
169
  - **Cross-platform compatibility** – works in Docker, systemd, native installs, Windows, Linux, macOS
167
170
  - **Graceful shutdown** – cleanly closes databases, flushes logs, terminates child processes
@@ -204,6 +207,8 @@ AutoUpdateEnabled = true
204
207
  AutoUpdateCron = "0 3 * * 0" # Weekly on Sunday at 3 AM
205
208
  ```
206
209
 
210
+ > 📝 **Note:** Auto-updates check GitHub releases for new versions. Only published (non-draft) releases trigger updates. Binary installations receive update notifications but require manual download.
211
+
207
212
  ### 🐳 Run with Docker
208
213
  **Minimal setup:**
209
214
  ```bash
@@ -533,38 +538,238 @@ AutoPauseResume = true # Required for FreeSpace to work
533
538
  **Disable monitoring:**
534
539
  ```toml
535
540
  [Settings]
536
- FreeSpace = "-1" # Disables free space checking
537
- ```
541
+ ### 🔄 Auto-Updates & Restarts
542
+
543
+ qBitrr can automatically update itself by checking GitHub releases for new versions. The update behavior varies by installation type.
544
+
545
+ #### 🔍 How Updates Work
546
+
547
+ **Update Detection:**
548
+ 1. 📡 Queries GitHub API for latest **published** (non-draft) release
549
+ 2. 🔢 Compares release version with current version using semantic versioning
550
+ 3. ⏩ Skips prereleases (beta, rc, alpha) by default
551
+ 4. 📦 Only updates when a newer **stable** version is available
552
+
553
+ **Installation Types:**
554
+
555
+ | Type | Detection | Update Method | Version Control |
556
+ |------|-----------|---------------|-----------------|
557
+ | **Git** | `.git` directory exists | `git checkout <tag>` or `git pull` | Checks out specific release tag |
558
+ | **PyPI** | Installed via pip | `pip install qBitrr2==<version>` | Installs exact version from PyPI |
559
+ | **Binary** | PyInstaller executable | Notification only | Logs download URL for manual update |
560
+
561
+ **Why different methods?**
562
+ - **Git installations** can checkout specific tags for precise version control
563
+ - **PyPI installations** can pin to exact versions for reliability
564
+ - **Binary installations** cannot self-update (would require replacing running executable), so qBitrr logs the download URL and version info for manual update
538
565
 
539
566
  ---
540
567
 
541
- ### 🔄 Auto-Updates & Restarts
568
+ #### ⚙️ Configuration
542
569
 
543
- **Scheduled Updates:**
570
+ **Basic Setup:**
544
571
  ```toml
545
572
  [Settings]
546
573
  AutoUpdateEnabled = true
547
574
  AutoUpdateCron = "0 3 * * 0" # Cron expression (default: Sunday 3 AM)
548
575
  ```
549
576
 
550
- **Manual Updates:**
551
- - Click "Update Now" in WebUI Config tab
552
- - Automatically downloads latest version
553
- - Performs graceful restart
577
+ **Cron Expression Examples:**
578
+ ```toml
579
+ "0 3 * * 0" # Every Sunday at 3:00 AM
580
+ "0 */6 * * *" # Every 6 hours
581
+ "0 0 * * *" # Daily at midnight
582
+ "0 2 * * 1-5" # Weekdays at 2:00 AM
583
+ ```
584
+
585
+ ---
586
+
587
+ #### 📋 Update Process Flow
588
+
589
+ **For Git & PyPI Installations:**
590
+
591
+ 1. **Check Phase:**
592
+ - Fetch latest release from GitHub API
593
+ - Validate release is not draft or prerelease
594
+ - Compare versions (semantic versioning)
595
+ - Skip if already on latest version
596
+
597
+ 2. **Download Phase:**
598
+ - **Git:** `git fetch --tags && git checkout v<version>`
599
+ - **PyPI:** `pip install --upgrade qBitrr2==<version>`
600
+
601
+ 3. **Verification Phase:**
602
+ - Reload version information
603
+ - Verify installed version matches target
604
+ - Log warning if mismatch
605
+
606
+ 4. **Restart Phase:**
607
+ - Gracefully shutdown (close DBs, flush logs)
608
+ - Terminate child processes
609
+ - Execute in-place restart via `os.execv()`
610
+ - Maintain same PID (systemd-friendly)
611
+
612
+ **For Binary Installations:**
613
+
614
+ 1. **Check Phase:** Same as above
615
+ 2. **Notification:** Logs message with download URL and instructions
616
+ 3. **Manual Update:** User downloads new binary from GitHub releases
617
+ 4. **No Auto-Restart:** User manually restarts after replacing binary
618
+
619
+ Example binary update log:
620
+ ```
621
+ [INFO] Update available: v5.4.2 -> v5.4.3
622
+ [INFO] Binary installation detected - manual update required
623
+ [INFO] Download: https://github.com/Feramance/qBitrr/releases/latest
624
+ [INFO] Instructions:
625
+ 1. Download the binary for your platform
626
+ 2. Extract the archive
627
+ 3. Replace current executable with new binary
628
+ 4. Restart qBitrr
629
+ ```
630
+
631
+ ---
632
+
633
+ #### 🔧 Manual Updates
634
+
635
+ **Via WebUI:**
636
+ - Navigate to **Config tab**
637
+ - Click **"Check for Updates"** to see available version
638
+ - Click **"Update Now"** button
639
+ - Confirm when prompted
640
+ - Application restarts automatically (git/pip only)
641
+
642
+ **Via Command Line:**
643
+
644
+ ```bash
645
+ # Git installation
646
+ cd /path/to/qBitrr
647
+ git fetch --tags
648
+ git checkout v5.4.3 # or: git pull
649
+ qbitrr # restart
650
+
651
+ # PyPI installation
652
+ pip install --upgrade qBitrr2
653
+ # or: pip install qBitrr2==5.4.3 # specific version
654
+ qbitrr # restart
655
+
656
+ # Binary installation
657
+ # Download from: https://github.com/Feramance/qBitrr/releases/latest
658
+ # Extract and replace binary, then restart
659
+
660
+ # Docker installation
661
+ docker pull feramance/qbitrr:latest
662
+ docker restart qbitrr
663
+ # or: docker-compose pull && docker-compose up -d
664
+ ```
665
+
666
+ ---
667
+
668
+ #### 🔐 Security & Reliability
669
+
670
+ **GitHub API Dependency:**
671
+ - Auto-update requires GitHub API access
672
+ - Rate limit: 60 requests/hour (unauthenticated)
673
+ - Cron schedule should account for rate limits
674
+ - Failures are logged but don't crash the application
675
+
676
+ **Version Verification:**
677
+ - After update, qBitrr verifies installed version
678
+ - Helps catch failed updates or PyPI lag issues
679
+ - Logs warning if version mismatch detected
680
+
681
+ **Draft & Prerelease Handling:**
682
+ - Draft releases are **always skipped** (unpublished)
683
+ - Prereleases (beta/rc/alpha) are skipped by default
684
+ - Useful for testing but not recommended for production
685
+
686
+ **Rollback:**
687
+ - Git installations: `git checkout <previous-tag>`
688
+ - PyPI installations: `pip install qBitrr2==<previous-version>`
689
+ - Binary installations: Keep backup of previous binary
690
+ - No automatic rollback (manual intervention required)
691
+
692
+ ---
693
+
694
+ #### 🚀 Restart Mechanism
695
+
696
+ **How it Works:**
697
+ ```python
698
+ os.execv(sys.executable, [sys.executable] + sys.argv)
699
+ ```
700
+
701
+ **Benefits:**
702
+ - ✅ **Same PID** – systemd doesn't detect a restart
703
+ - ✅ **No supervisor** – doesn't require external process manager
704
+ - ✅ **Clean state** – fresh Python interpreter, no memory leaks
705
+ - ✅ **Fast** – near-instant restart (< 1 second)
706
+
707
+ **Supported Environments:**
708
+ - 🐳 **Docker** – container stays running, process restarts
709
+ - ⚙️ **systemd** – service remains "active", no restart count increment
710
+ - 💻 **Native** – works on Linux, macOS, Windows
711
+ - 🪟 **Windows** – handles different executable extensions (.exe, .cmd)
712
+
713
+ **Graceful Shutdown:**
714
+ 1. Stop all Arr manager child processes
715
+ 2. Close database connections
716
+ 3. Flush log buffers to disk
717
+ 4. Release file locks
718
+ 5. Execute in-place restart
719
+
720
+ ---
554
721
 
555
- **Restart Mechanism:**
556
- - Uses `os.execv()` for in-place process replacement
557
- - Maintains same PID (systemd-friendly)
558
- - Works in Docker, systemd, native installs
559
- - Cross-platform: Linux, macOS, Windows
560
- - Graceful shutdown: closes databases, flushes logs, terminates child processes
722
+ #### 🛠️ Restart via API
561
723
 
562
- **Restart via API:**
724
+ **Restart entire application:**
563
725
  ```bash
564
- # Restart entire application
565
726
  curl -X POST http://localhost:6969/api/restart
566
727
 
567
- # Restart specific Arr manager
728
+ # With authentication
729
+ curl -X POST http://localhost:6969/api/restart \
730
+ -H "Authorization: Bearer your-token"
731
+ ```
732
+
733
+ **Restart specific Arr manager:**
734
+ ```bash
735
+ curl -X POST http://localhost:6969/api/arr/radarr-movies/restart
736
+ ```
737
+
738
+ ---
739
+
740
+ #### ⚠️ Troubleshooting Updates
741
+
742
+ **Update not triggering:**
743
+ - ✅ Check `AutoUpdateEnabled = true` in config
744
+ - ✅ Verify cron expression is valid (use [crontab.guru](https://crontab.guru))
745
+ - ✅ Check `Main.log` for GitHub API errors
746
+ - ✅ Ensure internet connectivity to api.github.com
747
+ - ✅ Check if already on latest version
748
+
749
+ **Version mismatch after update:**
750
+ - ✅ Review logs for pip/git errors
751
+ - ✅ Manually verify installation: `pip show qBitrr2` or `git describe`
752
+ - ✅ Check if PyPI is behind GitHub releases (can take hours)
753
+ - ✅ Try manual update to force correct version
754
+
755
+ **Binary updates not working:**
756
+ - ℹ️ **Expected behavior** – binaries cannot auto-update
757
+ - ✅ Check logs for download URL
758
+ - ✅ Download matching binary for your platform
759
+ - ✅ Extract and replace current executable
760
+ - ✅ Ensure new binary has execute permissions (Unix)
761
+
762
+ **Restart fails:**
763
+ - ✅ Check file permissions on qBitrr installation
764
+ - ✅ Review systemd journal if using systemd
765
+ - ✅ Verify no file locks preventing restart
766
+ - ✅ Check disk space for logs and databases
767
+ - ✅ Manual restart: Stop service, start again
768
+
769
+ **For systemd users:** See [SYSTEMD_SERVICE.md](SYSTEMD_SERVICE.md) for automatic restart configuration with `Restart=always`.
770
+
771
+ ---
772
+
568
773
  curl -X POST http://localhost:6969/api/arr/radarr-movies/restart
569
774
  ```
570
775
 
@@ -76,8 +76,11 @@ qBitrr is the intelligent glue between qBittorrent and the *Arr ecosystem (Radar
76
76
  - **Path-specific monitoring** – watch specific directories for space issues
77
77
 
78
78
  ### 🔄 Auto-Updates & Self-Healing
79
+ - **GitHub release-based updates** – automatically checks for published (non-draft) releases via GitHub API
79
80
  - **Scheduled auto-updates** – update qBitrr on a cron schedule (default: weekly Sunday 3 AM)
80
81
  - **Manual update trigger** – one-click updates from WebUI
82
+ - **Installation-aware updates** – detects git/pip/binary installs and uses appropriate update method
83
+ - **Version verification** – confirms installed version matches target before restart
81
84
  - **Smart restart mechanism** – uses `os.execv()` for true in-place restarts (no supervisor needed)
82
85
  - **Cross-platform compatibility** – works in Docker, systemd, native installs, Windows, Linux, macOS
83
86
  - **Graceful shutdown** – cleanly closes databases, flushes logs, terminates child processes
@@ -120,6 +123,8 @@ AutoUpdateEnabled = true
120
123
  AutoUpdateCron = "0 3 * * 0" # Weekly on Sunday at 3 AM
121
124
  ```
122
125
 
126
+ > 📝 **Note:** Auto-updates check GitHub releases for new versions. Only published (non-draft) releases trigger updates. Binary installations receive update notifications but require manual download.
127
+
123
128
  ### 🐳 Run with Docker
124
129
  **Minimal setup:**
125
130
  ```bash
@@ -449,38 +454,238 @@ AutoPauseResume = true # Required for FreeSpace to work
449
454
  **Disable monitoring:**
450
455
  ```toml
451
456
  [Settings]
452
- FreeSpace = "-1" # Disables free space checking
453
- ```
457
+ ### 🔄 Auto-Updates & Restarts
458
+
459
+ qBitrr can automatically update itself by checking GitHub releases for new versions. The update behavior varies by installation type.
460
+
461
+ #### 🔍 How Updates Work
462
+
463
+ **Update Detection:**
464
+ 1. 📡 Queries GitHub API for latest **published** (non-draft) release
465
+ 2. 🔢 Compares release version with current version using semantic versioning
466
+ 3. ⏩ Skips prereleases (beta, rc, alpha) by default
467
+ 4. 📦 Only updates when a newer **stable** version is available
468
+
469
+ **Installation Types:**
470
+
471
+ | Type | Detection | Update Method | Version Control |
472
+ |------|-----------|---------------|-----------------|
473
+ | **Git** | `.git` directory exists | `git checkout <tag>` or `git pull` | Checks out specific release tag |
474
+ | **PyPI** | Installed via pip | `pip install qBitrr2==<version>` | Installs exact version from PyPI |
475
+ | **Binary** | PyInstaller executable | Notification only | Logs download URL for manual update |
476
+
477
+ **Why different methods?**
478
+ - **Git installations** can checkout specific tags for precise version control
479
+ - **PyPI installations** can pin to exact versions for reliability
480
+ - **Binary installations** cannot self-update (would require replacing running executable), so qBitrr logs the download URL and version info for manual update
454
481
 
455
482
  ---
456
483
 
457
- ### 🔄 Auto-Updates & Restarts
484
+ #### ⚙️ Configuration
458
485
 
459
- **Scheduled Updates:**
486
+ **Basic Setup:**
460
487
  ```toml
461
488
  [Settings]
462
489
  AutoUpdateEnabled = true
463
490
  AutoUpdateCron = "0 3 * * 0" # Cron expression (default: Sunday 3 AM)
464
491
  ```
465
492
 
466
- **Manual Updates:**
467
- - Click "Update Now" in WebUI Config tab
468
- - Automatically downloads latest version
469
- - Performs graceful restart
493
+ **Cron Expression Examples:**
494
+ ```toml
495
+ "0 3 * * 0" # Every Sunday at 3:00 AM
496
+ "0 */6 * * *" # Every 6 hours
497
+ "0 0 * * *" # Daily at midnight
498
+ "0 2 * * 1-5" # Weekdays at 2:00 AM
499
+ ```
500
+
501
+ ---
502
+
503
+ #### 📋 Update Process Flow
504
+
505
+ **For Git & PyPI Installations:**
506
+
507
+ 1. **Check Phase:**
508
+ - Fetch latest release from GitHub API
509
+ - Validate release is not draft or prerelease
510
+ - Compare versions (semantic versioning)
511
+ - Skip if already on latest version
512
+
513
+ 2. **Download Phase:**
514
+ - **Git:** `git fetch --tags && git checkout v<version>`
515
+ - **PyPI:** `pip install --upgrade qBitrr2==<version>`
516
+
517
+ 3. **Verification Phase:**
518
+ - Reload version information
519
+ - Verify installed version matches target
520
+ - Log warning if mismatch
521
+
522
+ 4. **Restart Phase:**
523
+ - Gracefully shutdown (close DBs, flush logs)
524
+ - Terminate child processes
525
+ - Execute in-place restart via `os.execv()`
526
+ - Maintain same PID (systemd-friendly)
527
+
528
+ **For Binary Installations:**
529
+
530
+ 1. **Check Phase:** Same as above
531
+ 2. **Notification:** Logs message with download URL and instructions
532
+ 3. **Manual Update:** User downloads new binary from GitHub releases
533
+ 4. **No Auto-Restart:** User manually restarts after replacing binary
534
+
535
+ Example binary update log:
536
+ ```
537
+ [INFO] Update available: v5.4.2 -> v5.4.3
538
+ [INFO] Binary installation detected - manual update required
539
+ [INFO] Download: https://github.com/Feramance/qBitrr/releases/latest
540
+ [INFO] Instructions:
541
+ 1. Download the binary for your platform
542
+ 2. Extract the archive
543
+ 3. Replace current executable with new binary
544
+ 4. Restart qBitrr
545
+ ```
546
+
547
+ ---
548
+
549
+ #### 🔧 Manual Updates
550
+
551
+ **Via WebUI:**
552
+ - Navigate to **Config tab**
553
+ - Click **"Check for Updates"** to see available version
554
+ - Click **"Update Now"** button
555
+ - Confirm when prompted
556
+ - Application restarts automatically (git/pip only)
557
+
558
+ **Via Command Line:**
559
+
560
+ ```bash
561
+ # Git installation
562
+ cd /path/to/qBitrr
563
+ git fetch --tags
564
+ git checkout v5.4.3 # or: git pull
565
+ qbitrr # restart
566
+
567
+ # PyPI installation
568
+ pip install --upgrade qBitrr2
569
+ # or: pip install qBitrr2==5.4.3 # specific version
570
+ qbitrr # restart
571
+
572
+ # Binary installation
573
+ # Download from: https://github.com/Feramance/qBitrr/releases/latest
574
+ # Extract and replace binary, then restart
575
+
576
+ # Docker installation
577
+ docker pull feramance/qbitrr:latest
578
+ docker restart qbitrr
579
+ # or: docker-compose pull && docker-compose up -d
580
+ ```
581
+
582
+ ---
583
+
584
+ #### 🔐 Security & Reliability
585
+
586
+ **GitHub API Dependency:**
587
+ - Auto-update requires GitHub API access
588
+ - Rate limit: 60 requests/hour (unauthenticated)
589
+ - Cron schedule should account for rate limits
590
+ - Failures are logged but don't crash the application
591
+
592
+ **Version Verification:**
593
+ - After update, qBitrr verifies installed version
594
+ - Helps catch failed updates or PyPI lag issues
595
+ - Logs warning if version mismatch detected
596
+
597
+ **Draft & Prerelease Handling:**
598
+ - Draft releases are **always skipped** (unpublished)
599
+ - Prereleases (beta/rc/alpha) are skipped by default
600
+ - Useful for testing but not recommended for production
601
+
602
+ **Rollback:**
603
+ - Git installations: `git checkout <previous-tag>`
604
+ - PyPI installations: `pip install qBitrr2==<previous-version>`
605
+ - Binary installations: Keep backup of previous binary
606
+ - No automatic rollback (manual intervention required)
607
+
608
+ ---
609
+
610
+ #### 🚀 Restart Mechanism
611
+
612
+ **How it Works:**
613
+ ```python
614
+ os.execv(sys.executable, [sys.executable] + sys.argv)
615
+ ```
616
+
617
+ **Benefits:**
618
+ - ✅ **Same PID** – systemd doesn't detect a restart
619
+ - ✅ **No supervisor** – doesn't require external process manager
620
+ - ✅ **Clean state** – fresh Python interpreter, no memory leaks
621
+ - ✅ **Fast** – near-instant restart (< 1 second)
622
+
623
+ **Supported Environments:**
624
+ - 🐳 **Docker** – container stays running, process restarts
625
+ - ⚙️ **systemd** – service remains "active", no restart count increment
626
+ - 💻 **Native** – works on Linux, macOS, Windows
627
+ - 🪟 **Windows** – handles different executable extensions (.exe, .cmd)
628
+
629
+ **Graceful Shutdown:**
630
+ 1. Stop all Arr manager child processes
631
+ 2. Close database connections
632
+ 3. Flush log buffers to disk
633
+ 4. Release file locks
634
+ 5. Execute in-place restart
635
+
636
+ ---
470
637
 
471
- **Restart Mechanism:**
472
- - Uses `os.execv()` for in-place process replacement
473
- - Maintains same PID (systemd-friendly)
474
- - Works in Docker, systemd, native installs
475
- - Cross-platform: Linux, macOS, Windows
476
- - Graceful shutdown: closes databases, flushes logs, terminates child processes
638
+ #### 🛠️ Restart via API
477
639
 
478
- **Restart via API:**
640
+ **Restart entire application:**
479
641
  ```bash
480
- # Restart entire application
481
642
  curl -X POST http://localhost:6969/api/restart
482
643
 
483
- # Restart specific Arr manager
644
+ # With authentication
645
+ curl -X POST http://localhost:6969/api/restart \
646
+ -H "Authorization: Bearer your-token"
647
+ ```
648
+
649
+ **Restart specific Arr manager:**
650
+ ```bash
651
+ curl -X POST http://localhost:6969/api/arr/radarr-movies/restart
652
+ ```
653
+
654
+ ---
655
+
656
+ #### ⚠️ Troubleshooting Updates
657
+
658
+ **Update not triggering:**
659
+ - ✅ Check `AutoUpdateEnabled = true` in config
660
+ - ✅ Verify cron expression is valid (use [crontab.guru](https://crontab.guru))
661
+ - ✅ Check `Main.log` for GitHub API errors
662
+ - ✅ Ensure internet connectivity to api.github.com
663
+ - ✅ Check if already on latest version
664
+
665
+ **Version mismatch after update:**
666
+ - ✅ Review logs for pip/git errors
667
+ - ✅ Manually verify installation: `pip show qBitrr2` or `git describe`
668
+ - ✅ Check if PyPI is behind GitHub releases (can take hours)
669
+ - ✅ Try manual update to force correct version
670
+
671
+ **Binary updates not working:**
672
+ - ℹ️ **Expected behavior** – binaries cannot auto-update
673
+ - ✅ Check logs for download URL
674
+ - ✅ Download matching binary for your platform
675
+ - ✅ Extract and replace current executable
676
+ - ✅ Ensure new binary has execute permissions (Unix)
677
+
678
+ **Restart fails:**
679
+ - ✅ Check file permissions on qBitrr installation
680
+ - ✅ Review systemd journal if using systemd
681
+ - ✅ Verify no file locks preventing restart
682
+ - ✅ Check disk space for logs and databases
683
+ - ✅ Manual restart: Stop service, start again
684
+
685
+ **For systemd users:** See [SYSTEMD_SERVICE.md](SYSTEMD_SERVICE.md) for automatic restart configuration with `Restart=always`.
686
+
687
+ ---
688
+
484
689
  curl -X POST http://localhost:6969/api/arr/radarr-movies/restart
485
690
  ```
486
691
 
@@ -28,7 +28,7 @@ target-version = ['py312']
28
28
 
29
29
  [tool.poetry]
30
30
  name = "pypi-public"
31
- version = "5.4.3"
31
+ version = "5.4.5"
32
32
  description = "Intelligent automation for qBittorrent and *Arr apps (Radarr/Sonarr/Lidarr) - health monitoring, instant imports, quality upgrades, request integration"
33
33
  authors = ["Drapersniper", "Feramance"]
34
34
  readme = "README.md"