Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bugfix_music
Browse files Browse the repository at this point in the history
1337-server authored Nov 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents fd9b28a + f43f3e3 commit ee544e4
Showing 5 changed files with 36 additions and 1 deletion.
26 changes: 26 additions & 0 deletions arm/migrations/versions/469d88477c13_add_ui_base_url_to_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Add UI_BASE_URL to config
Revision ID: 469d88477c13
Revises: 2e0dc31fcb2e
Create Date: 2023-11-01 22:22:10.112867
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '469d88477c13'
down_revision = '2e0dc31fcb2e'
branch_labels = None
depends_on = None


def upgrade():
op.add_column('config',
sa.Column('UI_BASE_URL', sa.String(length=128), nullable=True)
)


def downgrade():
op.drop_column('config', 'UI_BASE_URL')
1 change: 1 addition & 0 deletions arm/models/config.py
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ class Config(db.Model):
DBFILE = db.Column(db.String(255))
WEBSERVER_IP = db.Column(db.String(25))
WEBSERVER_PORT = db.Column(db.Integer)
UI_BASE_URL = db.Column(db.String(128))
SET_MEDIA_PERMISSIONS = db.Column(db.Boolean)
CHMOD_VALUE = db.Column(db.Integer)
SET_MEDIA_OWNER = db.Column(db.Boolean)
6 changes: 5 additions & 1 deletion arm/ripper/utils.py
Original file line number Diff line number Diff line change
@@ -96,10 +96,14 @@ def notify_entry(job):
f"{job.disctype} at {datetime.datetime.now()}")
database_adder(notification)
if job.disctype in ["dvd", "bluray"]:
if cfg.arm_config["UI_BASE_URL"] == "":
display_address = (f"http://{check_ip()}:{job.config.WEBSERVER_PORT}")
else:
display_address = str(cfg.arm_config["UI_BASE_URL"])
# Send the notifications
notify(job, NOTIFY_TITLE,
f"Found disc: {job.title}. Disc type is {job.disctype}. Main Feature is {job.config.MAINFEATURE}."
f"Edit entry here: http://{check_ip()}:{job.config.WEBSERVER_PORT}/jobdetail?job_id={job.job_id}")
f"Edit entry here: {display_address}/jobdetail?job_id={job.job_id}")
elif job.disctype == "music":
notify(job, NOTIFY_TITLE, f"Found music CD: {job.label}. Ripping all tracks")
elif job.disctype == "data":
1 change: 1 addition & 0 deletions arm/ui/comments.json
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@
"DBFILE": "# Path to ARM database file",
"WEBSERVER_IP": "# IP address of web server (this machine)\n# Use x.x.x.x to autodetect the IP address to use",
"WEBSERVER_PORT": "# Port for web server",
"UI_BASE_URL": "# Base URL to use for notifications and display purposes\n#Be sure to include protocol and port if needed (e.g. http://example.com:8091 or https://example.com)",
"SET_MEDIA_PERMISSIONS": "# Enabling this setting will allow you to adjust the default file permissions of the outputted files\n# The default value is set to 777 for read/write/execute for all users, but can be changed below using the \"CHMOD_VALUE\" setting\n# This setting is helpful when storing the data locally on the system",
"CHMOD_VALUE": "",
"SET_MEDIA_OWNER": "# Don't bother. This does not do anything yet",
3 changes: 3 additions & 0 deletions setup/arm.yaml
Original file line number Diff line number Diff line change
@@ -165,6 +165,9 @@ WEBSERVER_IP: x.x.x.x
# Port for web server
WEBSERVER_PORT: 8080

# Base URL to use for notifications and display purposes
# Be sure to include protocol and port if needed (e.g. http://example.com:8091 or https://example.com)
UI_BASE_URL: ""

########################
## File Permissions ##

0 comments on commit ee544e4

Please sign in to comment.