Skip to content

Commit

Permalink
Fix add, rmeove, up, down, paus, resume
Browse files Browse the repository at this point in the history
  • Loading branch information
dmzoneill committed May 18, 2024
1 parent 4e00538 commit 398b5d2
Show file tree
Hide file tree
Showing 25 changed files with 70 additions and 1,581 deletions.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM fedora:40

# Install necessary packages
RUN dnf update -y && \
dnf install -y python3 python3-pip python3-gobject gtk4 xauth mesa-libGL mesa-dri-drivers
dnf install -y python3 python3-pip python3-gobject gtk4 xauth mesa-libGL mesa-dri-drivers which

# Set user and group IDs
ARG USER_ID
Expand Down Expand Up @@ -33,6 +33,13 @@ ENV LIBGL_ALWAYS_SOFTWARE=1
# Install Python dependencies
RUN pip3 install -r requirements.txt --no-warn-script-location

USER 0

RUN ln -s /home/dfakeseeder/.local/bin/py.test /usr/bin/pytest

# Switch to the created user
USER ${USER_NAME}

# Copy application code
COPY . /app

Expand Down
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ run-debug-docker: ui-build
-e DFS_PATH=/app \
-e DISPLAY=$$DISPLAY \
-v $$HOME/.config/dfakeseeder:/home/dfakeseeder/.config/dfakeseeder \
-v $$HOME/Downloads:/home/dfakeseeder/Downloads \
-v $$(pwd):/app \
-v /tmp/.X11-unix:/tmp/.X11-unix \
dfakeseeder
Expand Down Expand Up @@ -194,7 +195,28 @@ translate:
#$(MAKE) translatexml

test:
DFS_PATH=$$(pwd)/d_fake_seeder pytest -vvv tests/
DFS_PATH=$$(pwd)/d_fake_seeder cd d_fake_seeder/ && pytest -vvv .

test-docker:
-docker build \
--build-arg USER_ID=$$(id -u) \
--build-arg GROUP_ID=$$(id -g) \
-t dfakeseeder .

-docker ps -a -q --filter "name=dfakeseeder" | xargs -r docker rm -f

-docker run --privileged -it --rm \
--name dfakeseeder \
-e LOG_LEVEL=INFO \
-e DFS_PATH=/app \
-e DISPLAY=$$DISPLAY \
-e PYTHONPATH=/app/d_fake_seeder/ \
-v $$HOME/.config/dfakeseeder:/home/dfakeseeder/.config/dfakeseeder \
-v $$HOME/Downloads:/home/dfakeseeder/Downloads \
-v $$(pwd):/app \
-v /tmp/.X11-unix:/tmp/.X11-unix \
dfakeseeder \
pytest -s -x -vvv .

flatpak: clean
flatpak-builder build-dir ie.fio.dfakeseeder manifest.json
77 changes: 37 additions & 40 deletions d_fake_seeder/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,62 @@
"total_upload_speed": 50,
"total_download_speed": 500,
"announce_interval": 1800,
"torrents": {
},
"torrents": {},
"http_headers": {
"Accept-Encoding": "gzip",
"User-Agent": "Deluge/2.0.3 libtorrent/2.0.5.0"
"Accept-Encoding": "gzip",
"User-Agent": "Deluge/2.0.3 libtorrent/2.0.5.0"
},
"agents": [
"Deluge/2.0.3 libtorrent/2.0.5.0",
"qBittorrent/4.3.1",
"Transmission/3.00",
"uTorrent/3.5.5",
"Vuze/5.7.6.0",
"BitTorrent/7.10.5",
"rTorrent/0.9.6"
"Deluge/2.0.3 libtorrent/2.0.5.0,-DE2003-",
"qBittorrent/4.3.1,-qB4310-",
"Transmission/3.00,-TR3000-",
"uTorrent/3.5.5,-UT3550-",
"Vuze/5.7.6.0,-AZ5760-",
"BitTorrent/7.10.5,-BT7105-",
"rTorrent/0.9.6,-RT0960-"
],
"agent": 0,
"proxies": {
"http": "",
"https": ""
"http": "",
"https": ""
},
"columns": "",
"concurrent_http_connections": 2,
"concurrent_peer_connections": 10,
"cellrenderers": {
"progress": "Gtk.ProgressBar"
"progress": "Gtk.ProgressBar"
},
"textrenderers": {
"total_uploaded": "humanbytes",
"total_downloaded": "humanbytes",
"session_uploaded": "humanbytes",
"session_downloaded": "humanbytes",
"total_size": "humanbytes",
"announce_interval": "convert_seconds_to_hours_mins_seconds",
"next_update": "convert_seconds_to_hours_mins_seconds",
"upload_speed": "add_kb",
"download_speed": "add_kb",
"threshold": "add_percent"
"total_uploaded": "humanbytes",
"total_downloaded": "humanbytes",
"session_uploaded": "humanbytes",
"session_downloaded": "humanbytes",
"total_size": "humanbytes",
"announce_interval": "convert_seconds_to_hours_mins_seconds",
"next_update": "convert_seconds_to_hours_mins_seconds",
"upload_speed": "add_kb",
"download_speed": "add_kb",
"threshold": "add_percent"
},
"threshold": 30,
"tickspeed": 3,
"tickspeed": 9,
"editwidgets": {
"active": "Gtk.Switch",
"announce_interval": "Gtk.SpinButton",
"download_speed": "Gtk.SpinButton",
"next_update": "Gtk.SpinButton",
"session_downloaded": "Gtk.SpinButton",
"session_uploaded": "Gtk.SpinButton",
"small_torrent_limit": "Gtk.SpinButton",
"threshold": "Gtk.SpinButton",
"total_downloaded": "Gtk.SpinButton",
"total_uploaded": "Gtk.SpinButton",
"upload_speed": "Gtk.SpinButton"
},
"object": {
"torrents": {}
"active": "Gtk.Switch",
"announce_interval": "Gtk.SpinButton",
"download_speed": "Gtk.SpinButton",
"next_update": "Gtk.SpinButton",
"session_downloaded": "Gtk.SpinButton",
"session_uploaded": "Gtk.SpinButton",
"small_torrent_limit": "Gtk.SpinButton",
"threshold": "Gtk.SpinButton",
"total_downloaded": "Gtk.SpinButton",
"total_uploaded": "Gtk.SpinButton",
"upload_speed": "Gtk.SpinButton"
},
"issues_page": "https://github.com/dmzoneill/DFakeSeeder/issues",
"website": "https://github.com/dmzoneill/DFakeSeeder/",
"author": "David O Neill",
"copyright": "Copyright {year}",
"version": "1.0",
"logo": "images/dfakeseeder.png"
}
}
9 changes: 2 additions & 7 deletions d_fake_seeder/lib/component/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,11 @@ def on_dialog_response(self, dialog, response_id):
)
# Get the selected file
selected_file = dialog.get_file()
print("Selected File:", selected_file)
current_path = os.path.dirname(os.path.abspath(__file__))
torrents_path = os.path.join(current_path, "torrents")
torrents_path = os.path.expanduser("~/.config/dfakeseeder/torrents")
shutil.copy(os.path.abspath(selected_file.get_path()), torrents_path)

# Assuming selected_file is a GLocalFile object
file_path = selected_file.get_path()

copied_torrent_path = os.path.join(torrents_path, os.path.basename(file_path))
self.model.add_torrent(os.path.relpath(copied_torrent_path))
self.model.add_torrent(copied_torrent_path)
dialog.destroy()
else:
dialog.destroy()
Expand Down
File renamed without changes.
Empty file.
75 changes: 0 additions & 75 deletions d_fake_seeder/snippets/udptest.py

This file was deleted.

84 changes: 0 additions & 84 deletions tests/config/settings.json

This file was deleted.

34 changes: 0 additions & 34 deletions tests/lib/handlers/test_FileModifiedEventHandler.py

This file was deleted.

0 comments on commit 398b5d2

Please sign in to comment.