Skip to content

Commit

Permalink
Merge branch 'develop' into feature/player_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Neraste authored Feb 24, 2024
2 parents 846f699 + baf117e commit 2e61a6c
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 116 deletions.
91 changes: 0 additions & 91 deletions .appveyor.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Tests

on:
pull_request:
push:
branches:
- master
- develop

jobs:
unit-tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: pip install -r requirements.txt -r requirements_dev.txt

- name: Run tests
run: python -m pytest -v

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

static-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'

- name: Install dependencies
run: pip install -r requirements.txt -r requirements_dev.txt

- name: Run import order checks
run: python -m isort . --check

- name: Run style checks
run: python -m black . --check

- name: Run PEP8 style checks
run: python -m flake8
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ Any important notes regarding the update.

## Unreleased

### Added

- MacOS support.

## 1.8.1 - 2023-12-17

## 1.8.0 - 2022-11-23

### Update notes

The player does not need a special user any more to communicate with the server.
Expand All @@ -49,6 +57,7 @@ python dakara_server/manage.py shell -c "from users.models import DakaraUser; Da
- Tags, work types and works are now created with the feeder, using the routes `api/library/song-tags/`, `api/library/work-types/` and `api/library/works/` respectively.
- Player tokens are generated using the route `/api/playlist/player-token/`.
- Songs can be restarted, rewound, or fast forwarded during playback.
- Support Python 3.10 and 3.11.

### Changed

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Dakara Project
Copyright (c) 2023 Dakara Project

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Dakara server

<!-- Badges are displayed for the develop branch -->
[![Appveyor CI Build status](https://ci.appveyor.com/api/projects/status/2wdia71y3dwsqywp/branch/develop?svg=true)](https://ci.appveyor.com/project/neraste/dakara-server/branch/develop)
[![Tests status](https://github.com/DakaraProject/dakara-server/actions/workflows/ci.yml/badge.svg)](https://github.com/DakaraProject/dakara-server/actions/workflows/ci.yml)
[![Codecov coverage analysis](https://codecov.io/gh/DakaraProject/dakara-server/branch/develop/graph/badge.svg)](https://codecov.io/gh/DakaraProject/dakara-server)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

Server for the Dakara project.

Expand All @@ -18,9 +19,9 @@ Installation guidelines are provided over here:

### System requirements

* Python3, to make everything up and running (supported versions: 3.7, 3.8, 3.9 and 3.10).
* Python3, to make everything up and running (supported versions: 3.7, 3.8, 3.9, 3.10, and 3.11).

Linux and Windows are supported.
Linux, Mac and Windows are supported.

### Virtual environment

Expand Down
5 changes: 3 additions & 2 deletions dakara_server/dakara_server/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__version__ = "1.8.0-dev"
__date__ = "2021-06-20"
# this file is automatically updated by bump_version.sh, do not edit it!
__version__ = "1.9.0-dev"
__date__ = "2023-12-17"
12 changes: 10 additions & 2 deletions dakara_server/library/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class SongWorkLinkSerializer(serializers.ModelSerializer):

class Meta:
model = SongWorkLink
fields = ("work", "link_type", "link_type_number", "episodes")
fields = ("id", "work", "link_type", "link_type_number", "episodes")

@staticmethod
def set(song, songworklinks_data):
Expand Down Expand Up @@ -412,10 +412,18 @@ class SongForPlayerSerializer(serializers.ModelSerializer):
artists = ArtistSerializer(many=True, read_only=True)
works = SongWorkLinkSerializer(many=True, read_only=True, source="songworklink_set")
file_path = serializers.SerializerMethodField()
duration = SecondsDurationField()

class Meta:
model = Song
fields = ("title", "artists", "works", "file_path", "has_instrumental")
fields = (
"title",
"duration",
"artists",
"works",
"file_path",
"has_instrumental",
)

@staticmethod
def get_file_path(song):
Expand Down
2 changes: 1 addition & 1 deletion dakara_server/playlist/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def perform_update(self, serializer):
# check the player is not idle
player, _ = models.Player.cache.get_or_create(karaoke=karaoke)
if player.playlist_entry is None:
raise PermissionDenied("The player cannot receive commands when " "idle")
raise PermissionDenied("The player cannot receive commands when idle")

command = serializer.validated_data["command"]
send_to_channel("playlist.device", "send_command", {"command": command})
Expand Down
2 changes: 1 addition & 1 deletion dakara_server/users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Migration(migrations.Migration):
"Letters, digits and @/./+/-/_ only."
),
error_messages={
"unique": ("A user with that username " "already exists.")
"unique": ("A user with that username already exists.")
},
),
),
Expand Down
17 changes: 9 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
APScheduler>=3.9.1,<3.10.0
channels>=3.0.4,<3.1.0
channels>=3.0.5,<3.1.0
coreapi>=2.3.3,<2.4.0
dj-database-url>=0.5.0,<0.6.0
dj-database-url>=1.0.0,<1.1.0
django-cache-lock>=0.2.5,<0.3.0
django-filter>=2.4.0,<2.5.0
django-ordered-model>=3.4.0,<3.5.0
django-filter>=22.1,<22.2
django-ordered-model>=3.6,<3.7
django-rest-registration>=0.7.2,<0.8.0
Django>=3.2.12,<3.3.0
djangorestframework>=3.12.0,<3.13.1
Django>=3.2.16,<3.3.0
djangorestframework>=3.13.0,<3.14.0
Markdown>=3.3.0,<3.3.4; python_version < "3.8"
Markdown>=3.3.6,<3.4.0; python_version >= "3.8"
Pygments>=2.11.2,<2.12.0
Markdown>=3.4.1,<3.5.0; python_version >= "3.8"
Pygments>=2.13.0,<2.14.0
python-decouple>=3.6,<3.7
setuptools>=68
14 changes: 7 additions & 7 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
black>=22.3.0,<22.4.0
black>=22.10.0,<22.11.0
codecov>=2.1.12,<2.2.0
flake8>=4.0.1,<4.1.0
freezegun>=1.2.1,<1.3.0
flake8>=5.0.4,<5.1.0
isort>=5.10.1,<5.11.0
pre-commit>=2.18.1,<2.19.0
pytest-asyncio>=0.18.3,<0.19.0
pytest-cov>=3.0.0,<3.1.0
pre-commit>=2.20.0,<2.21.0
pytest-asyncio>=0.20.2,<0.21.0
pytest-cov>=4.0.0,<4.1.0
pytest-django>=4.5.2,<4.6.0
pytest-mock>=3.7.0,<3.8.0
pytest>=7.1.1,<7.2.0
pytest-mock>=3.10.0,<3.11.0
pytest>=7.2.0,<7.3.0

0 comments on commit 2e61a6c

Please sign in to comment.