.mypy_cache/
.tox/
*.egg-info/
+*.spec
-FROM python:3.8-alpine3.12
+FROM python:3.8-slim as builder
+ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple
+
+RUN set -x \
+ # Install buildtime packages
+ && apt-get update && apt-get install -y --no-install-recommends \
+ curl \
+ ca-certificates \
+ build-essential \
+ gcc \
+ libtag1-dev \
+ libffi-dev \
+ libssl-dev \
+ zlib1g-dev \
+ xvfb \
+ tcl8.6-dev \
+ tk8.6-dev \
+ libjpeg-turbo-progs \
+ libjpeg62-turbo-dev
+
+# build jemalloc
ARG JEMALLOC_VERSION=5.2.1
-WORKDIR /tmp
-COPY . .
+RUN curl -L -s https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2 \
+ | tar -xjf - -C /tmp \
+ && cd /tmp/jemalloc-${JEMALLOC_VERSION} \
+ && ./configure \
+ && make \
+ && make install
+
+# build python wheels
+WORKDIR /wheels
+COPY . /tmp
+RUN pip wheel uvloop cchardet aiodns brotlipy \
+ && pip wheel -r /tmp/requirements.txt \
+ # Include frontend-app in the source files
+ && curl -L https://github.com/music-assistant/app/archive/master.tar.gz | tar xz \
+ && mv app-master/docs /tmp/music_assistant/web/static \
+ && pip wheel /tmp
+
+#### FINAL IMAGE
+FROM python:3.8-slim AS final-image
-# Install packages
+WORKDIR /wheels
+COPY --from=builder /wheels /wheels
+COPY --from=builder /usr/local/lib/libjemalloc.so /usr/local/lib/libjemalloc.so
RUN set -x \
- && apk update \
- && echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
- && echo "http://dl-8.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
- # install default packages
- && apk add --no-cache \
+ # Install runtime dependency packages
+ && apt-get update \
+ && apt-get install -y --no-install-recommends \
+ curl \
tzdata \
ca-certificates \
- curl \
flac \
sox \
- libuv \
+ libsox-fmt-all \
ffmpeg \
- uchardet \
- # dependencies for pillow
- freetype \
- lcms2 \
- libimagequant \
- libjpeg-turbo \
- libwebp \
- libxcb \
- openjpeg \
- tiff \
- zlib \
- # install (temp) build packages
- && apk add --no-cache --virtual .build-deps \
- build-base \
- libsndfile-dev \
- taglib-dev \
- gcc \
- musl-dev \
- freetype-dev \
- libpng-dev \
- libressl-dev \
- fribidi-dev \
- harfbuzz-dev \
- jpeg-dev \
- lcms2-dev \
- openjpeg-dev \
- tcl-dev \
- tiff-dev \
- tk-dev \
- zlib-dev \
- libuv-dev \
- libffi-dev \
- uchardet-dev \
- # setup jemalloc
- && curl -L -f -s "https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2" \
- | tar -xjf - -C /tmp \
- && cd /tmp/jemalloc-${JEMALLOC_VERSION} \
- && ./configure \
- && make \
- && make install \
- && cd /tmp \
- # make sure optional packages are installed
- && pip install uvloop cchardet aiodns brotlipy \
- # install music assistant
- && pip install . \
- # cleanup build files
- && apk del .build-deps \
- && rm -rf /tmp/*
+ libtag1v5 \
+ openssl \
+ libjpeg62-turbo \
+ zlib1g \
+ # install music assistant (and all it's dependencies) using the prebuilt wheels
+ && pip install --no-cache-dir -f /wheels music_assistant \
+ # cleanup
+ && rm -rf /tmp/* \
+ && rm -rf /wheels \
+ && rm -rf /var/lib/apt/lists/* \
+ && rm -rf /root/*
ENV DEBUG=false
EXPOSE 8095/tcp
--- /dev/null
+FROM python:3.8-alpine3.12
+
+ARG JEMALLOC_VERSION=5.2.1
+WORKDIR /tmp
+COPY . .
+
+# Install packages
+RUN set -x \
+ && apk update \
+ && echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
+ && echo "http://dl-8.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
+ # install default packages
+ && apk add --no-cache \
+ tzdata \
+ ca-certificates \
+ curl \
+ flac \
+ sox \
+ libuv \
+ ffmpeg \
+ uchardet \
+ taglib \
+ libressl \
+ # dependencies for pillow
+ freetype \
+ lcms2 \
+ libimagequant \
+ libjpeg-turbo \
+ libwebp \
+ libxcb \
+ openjpeg \
+ tiff \
+ zlib \
+ # install (temp) build packages
+ && apk add --no-cache --virtual .build-deps \
+ build-base \
+ libsndfile-dev \
+ taglib-dev \
+ gcc \
+ musl-dev \
+ freetype-dev \
+ libpng-dev \
+ libressl-dev \
+ fribidi-dev \
+ harfbuzz-dev \
+ jpeg-dev \
+ lcms2-dev \
+ openjpeg-dev \
+ tcl-dev \
+ tiff-dev \
+ tk-dev \
+ zlib-dev \
+ libuv-dev \
+ libffi-dev \
+ uchardet-dev \
+ # setup jemalloc
+ && curl -L -f -s "https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2" \
+ | tar -xjf - -C /tmp \
+ && cd /tmp/jemalloc-${JEMALLOC_VERSION} \
+ && ./configure \
+ && make \
+ && make install \
+ && cd /tmp \
+ # make sure optional packages are installed
+ && pip install uvloop cchardet aiodns brotlipy \
+ # install music assistant
+ && pip install . \
+ # cleanup build files
+ && apk del .build-deps \
+ && rm -rf /tmp/*
+
+ENV DEBUG=false
+EXPOSE 8095/tcp
+
+VOLUME [ "/data" ]
+
+ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
+ENTRYPOINT ["mass", "--config", "/data"]
\ No newline at end of file
+++ /dev/null
-FROM python:3.8-slim as builder
-
-RUN set -x \
- # Install buildtime packages
- && apt-get update && apt-get install -y --no-install-recommends \
- curl \
- ca-certificates \
- build-essential \
- gcc \
- libtag1-dev \
- libffi-dev \
- openssl-dev
-
-# build jemalloc
-ARG JEMALLOC_VERSION=5.2.1
-RUN curl -L -s https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2 \
- | tar -xjf - -C /tmp \
- && cd /tmp/jemalloc-${JEMALLOC_VERSION} \
- && ./configure \
- && make \
- && make install
-
-# build python wheels
-WORKDIR /wheels
-COPY . /tmp
-RUN pip wheel uvloop cchardet aiodns brotlipy \
- && pip wheel --extra-index-url=https://www.piwheels.org/simple -r /tmp/requirements.txt \
- # Include frontend-app in the source files
- && curl -L https://github.com/music-assistant/app/archive/master.tar.gz | tar xz \
- && mv app-master/docs /tmp/music_assistant/web/static \
- && pip wheel --extra-index-url=https://www.piwheels.org/simple /tmp
-
-#### FINAL IMAGE
-FROM python:3.8-slim
-
-WORKDIR /wheels
-COPY --from=builder /wheels /wheels
-COPY --from=builder /usr/local/lib/libjemalloc.so /usr/local/lib/libjemalloc.so
-RUN set -x \
- # Install runtime dependency packages
- && apt-get update \
- && apt-get install -y --no-install-recommends \
- curl \
- tzdata \
- ca-certificates \
- flac \
- sox \
- libsox-fmt-all \
- ffmpeg \
- libtag1v5 \
- openssl \
- # install music assistant (and all it's dependencies) using the prebuilt wheels
- && pip install --no-cache-dir -f /wheels --extra-index-url=https://www.piwheels.org/simple music_assistant \
- # cleanup
- && rm -rf /tmp/* \
- && rm -rf /wheels \
- && rm -rf /var/lib/apt/lists/*
-
-ENV DEBUG=false
-EXPOSE 8095/tcp
-
-VOLUME [ "/data" ]
-
-ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
-ENTRYPOINT ["mass", "--config", "/data"]
\ No newline at end of file
# make sure that the token is still valid by just requesting it
await self.async_get_token()
spotty = self.get_spotty_binary()
- spotty_exec = '%s -n temp -c "%s" --pass-through --single-track %s' % (
- spotty,
- self.mass.config.data_path,
- track.item_id,
+ spotty_exec = (
+ '%s -n temp -c "%s" --pass-through --single-track spotify://track:%s'
+ % (
+ spotty,
+ self.mass.config.data_path,
+ track.item_id,
+ )
)
return StreamDetails(
type=StreamType.EXECUTABLE,
)
if platform.system() == "Darwin":
# macos binary is x86_64 intel
- return os.path.join(os.path.dirname(__file__), "spotty", "darwin", "spotty")
+ return os.path.join(os.path.dirname(__file__), "spotty", "osx", "spotty")
if platform.system() == "Linux":
architecture = platform.machine()
if architecture in ["AMD64", "x86_64"]:
if "aarch64" in architecture or "armv8" in architecture:
# arm64 linux binary
return os.path.join(
- os.path.dirname(__file__), "spotty", "x86-linux", "spotty-aarch64"
+ os.path.dirname(__file__), "spotty", "linux", "spotty-aarch64"
)
# assume armv7
return os.path.join(
- os.path.dirname(__file__), "spotty", "arm-linux", "spotty-armhf"
+ os.path.dirname(__file__), "spotty", "linux", "spotty-armhf"
)
return None
import ujson
from aiohttp.web import Request, Response, RouteTableDef, json_response
from aiohttp_jwt import login_required
+from music_assistant.helpers.util import json_serializer
from music_assistant.helpers.web import async_media_items_from_body, async_stream_json
routes = RouteTableDef()
if item_id is None or provider is None:
return Response(text="invalid item or provider", status=501)
result = await request.app["mass"].music.async_get_playlist(item_id, provider)
- return json_response(result)
+ return json_response(result, dumps=json_serializer)
@routes.get("/api/playlists/{item_id}/tracks")