Skip to content

Commit

Permalink
fix: 修复镜像缺少文件问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Jul 5, 2024
1 parent 45bbc8a commit ee7ffa5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app/ffmpeg /app/ffmpeg
COPY xiaomusic/ ./xiaomusic/
COPY plugins/ ./plugins/
COPY xiaomusic.py .
ENV XDG_CONFIG_HOME=/config
ENV XIAOMUSIC_HOSTNAME=192.168.2.5
Expand Down
8 changes: 0 additions & 8 deletions xiaomusic/plugin.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import importlib
import inspect
import os
import pkgutil
import sys


class PluginManager:
def __init__(self, xiaomusic, plugin_dir="plugins"):
self.xiaomusic = xiaomusic
self.log = xiaomusic.log
self._funcs = {}
self._add_plugin_dir_to_path(plugin_dir)
self._load_plugins(plugin_dir)

def _add_plugin_dir_to_path(self, plugin_dir):
plugin_dir_path = os.path.join(os.path.dirname(__file__), plugin_dir)
if plugin_dir_path not in sys.path:
sys.path.append(plugin_dir_path)

def _load_plugins(self, plugin_dir):
# 假设 plugins 已经在搜索路径上
package_name = plugin_dir
Expand Down

0 comments on commit ee7ffa5

Please sign in to comment.