winipedia-utils 0.1.62__py3-none-any.whl → 0.1.63__py3-none-any.whl

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.

Potentially problematic release.


This version of winipedia-utils might be problematic. Click here for more details.

@@ -44,6 +44,7 @@ class MediaPlayer(QMediaPlayer):
44
44
  """
45
45
  super().__init__(*args, **kwargs)
46
46
  self.parent_layout = parent_layout
47
+ self.io_device: PyQIODevice | None = None
47
48
  self.make_widget()
48
49
 
49
50
  def make_widget(self) -> None:
@@ -342,12 +343,12 @@ class MediaPlayer(QMediaPlayer):
342
343
  source_url: The QUrl representing the source location.
343
344
  position: The position to start playback from in milliseconds.
344
345
  """
345
- self.stop()
346
+ self.stop_and_close_io_device()
346
347
 
347
348
  self.resume_func = partial(self.resume_to_position, position=position)
348
349
  self.mediaStatusChanged.connect(self.resume_func)
349
350
 
350
- # prevents freezing when starting a new video while another is playing
351
+ # SingleShot prevents freezing when starting new video while another is playing
351
352
  QTimer.singleShot(
352
353
  100,
353
354
  partial(
@@ -355,6 +356,12 @@ class MediaPlayer(QMediaPlayer):
355
356
  ),
356
357
  )
357
358
 
359
+ def stop_and_close_io_device(self) -> None:
360
+ """Stop playback and close the IO device."""
361
+ self.stop()
362
+ if self.io_device is not None:
363
+ self.io_device.close()
364
+
358
365
  def resume_to_position(
359
366
  self, status: QMediaPlayer.MediaStatus, position: int
360
367
  ) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: winipedia-utils
3
- Version: 0.1.62
3
+ Version: 0.1.63
4
4
  Summary: A package with many utility functions
5
5
  License: MIT
6
6
  Author: Winipedia
@@ -54,7 +54,7 @@ winipedia_utils/pyside/ui/pages/player.py,sha256=qEInuNx8b_wl-HQNAppWL9BCdWEflXW
54
54
  winipedia_utils/pyside/ui/widgets/__init__.py,sha256=p-maJQh7gYbXwhkqKU4wL6UNGzRAy988JP8_qLoTZDk,24
55
55
  winipedia_utils/pyside/ui/widgets/browser.py,sha256=6PaymgIM7EL7tSoiyJ5So5Mt9JnOCdZIz9iAJ0x6mr8,8414
56
56
  winipedia_utils/pyside/ui/widgets/clickable_widget.py,sha256=TIQsLYnzgo7hyVjq_mKxo7IoSdwb20qt6JgkJj59ZVE,1779
57
- winipedia_utils/pyside/ui/widgets/media_player.py,sha256=09PM6XamO_NivAqLW4ZhXnbFSs8vSVGtQkERqeEkwjs,15924
57
+ winipedia_utils/pyside/ui/widgets/media_player.py,sha256=s-YlsGA4dwpnG-f0nbJ9wnhzmab21dNNoKLZqLBFkO4,16206
58
58
  winipedia_utils/pyside/ui/widgets/notification.py,sha256=FXNDFheLMWt57dVZhORrxU7uHhu7aMl8n8pDeqF5cU4,2557
59
59
  winipedia_utils/pyside/ui/windows/__init__.py,sha256=p-maJQh7gYbXwhkqKU4wL6UNGzRAy988JP8_qLoTZDk,24
60
60
  winipedia_utils/pyside/ui/windows/base/__init__.py,sha256=p-maJQh7gYbXwhkqKU4wL6UNGzRAy988JP8_qLoTZDk,24
@@ -94,7 +94,7 @@ winipedia_utils/testing/tests/base/utils/utils.py,sha256=dUPDrgAxlfREQb33zz23Mfz
94
94
  winipedia_utils/testing/tests/conftest.py,sha256=8RounBlI8Jq1aLaLNpv84MW4ne8Qq0aavQextDOp5ng,920
95
95
  winipedia_utils/text/__init__.py,sha256=j2bwtK6kyeHI6SnoBjpRju0C1W2n2paXBDlNjNtaUxA,48
96
96
  winipedia_utils/text/string.py,sha256=pK_VQXxSZa8HqHY1a6oMKfmN-OKteFE32eZaweCI22E,3508
97
- winipedia_utils-0.1.62.dist-info/LICENSE,sha256=3PrKJ2CWNrnyyHaC_r0wPDSukVWgmjOxHr__eQVH7cw,1087
98
- winipedia_utils-0.1.62.dist-info/METADATA,sha256=-zmhgCIHrMOahqLogF5EgnLzoUGwY1ojf2D4LdvHOZY,12576
99
- winipedia_utils-0.1.62.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
100
- winipedia_utils-0.1.62.dist-info/RECORD,,
97
+ winipedia_utils-0.1.63.dist-info/LICENSE,sha256=3PrKJ2CWNrnyyHaC_r0wPDSukVWgmjOxHr__eQVH7cw,1087
98
+ winipedia_utils-0.1.63.dist-info/METADATA,sha256=q4RkHbSqJpevmY04zRYIf-X4WERefMrmhBkUrKlDgVg,12576
99
+ winipedia_utils-0.1.63.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
100
+ winipedia_utils-0.1.63.dist-info/RECORD,,