harmony-plugin-api 0.1.1__tar.gz → 0.1.3__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 (17) hide show
  1. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/PKG-INFO +1 -1
  2. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/pyproject.toml +1 -1
  3. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/lyrics.py +6 -1
  4. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/manifest.py +7 -0
  5. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api.egg-info/PKG-INFO +1 -1
  6. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/README.md +0 -0
  7. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/setup.cfg +0 -0
  8. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/__init__.py +0 -0
  9. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/context.py +0 -0
  10. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/cover.py +0 -0
  11. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/media.py +0 -0
  12. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/online.py +0 -0
  13. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/plugin.py +0 -0
  14. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api/registry_types.py +0 -0
  15. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api.egg-info/SOURCES.txt +0 -0
  16. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api.egg-info/dependency_links.txt +0 -0
  17. {harmony_plugin_api-0.1.1 → harmony_plugin_api-0.1.3}/src/harmony_plugin_api.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: harmony-plugin-api
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Pure plugin SDK for Harmony plugins
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "harmony-plugin-api"
7
- version = "0.1.1"
7
+ version = "0.1.3"
8
8
  description = "Pure plugin SDK for Harmony plugins"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -6,7 +6,7 @@ from typing import Protocol
6
6
 
7
7
  @dataclass(frozen=True)
8
8
  class PluginLyricsResult:
9
- song_id: str
9
+ id: str
10
10
  title: str
11
11
  artist: str
12
12
  album: str = ""
@@ -17,6 +17,11 @@ class PluginLyricsResult:
17
17
  accesskey: str | None = None
18
18
  supports_yrc: bool = False
19
19
 
20
+ @property
21
+ def song_id(self) -> str:
22
+ """Backward-compatible alias for pre-id plugin implementations."""
23
+ return self.id
24
+
20
25
 
21
26
  class PluginLyricsSource(Protocol):
22
27
  source_id: str
@@ -47,6 +47,7 @@ class PluginManifest:
47
47
  capabilities: tuple[str, ...]
48
48
  min_app_version: str
49
49
  max_app_version: str | None = None
50
+ requires_restart_on_toggle: bool = False
50
51
 
51
52
  @classmethod
52
53
  def from_dict(cls, data: dict[str, Any]) -> "PluginManifest":
@@ -85,6 +86,11 @@ class PluginManifest:
85
86
  raise PluginManifestError(
86
87
  "Manifest field 'max_app_version' must be a string if provided"
87
88
  )
89
+ requires_restart_on_toggle = data.get("requires_restart_on_toggle", False)
90
+ if not isinstance(requires_restart_on_toggle, bool):
91
+ raise PluginManifestError(
92
+ "Manifest field 'requires_restart_on_toggle' must be a bool if provided"
93
+ )
88
94
 
89
95
  return cls(
90
96
  id=_require_str(data, "id"),
@@ -96,4 +102,5 @@ class PluginManifest:
96
102
  capabilities=capabilities,
97
103
  min_app_version=_require_str(data, "min_app_version"),
98
104
  max_app_version=max_app_version,
105
+ requires_restart_on_toggle=requires_restart_on_toggle,
99
106
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: harmony-plugin-api
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Pure plugin SDK for Harmony plugins
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown