Skip to content

Commit

Permalink
שיפורים קלים
Browse files Browse the repository at this point in the history
  • Loading branch information
NHLOCAL committed Jun 22, 2024
1 parent c53bb15 commit 594ea77
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:

- name: Install dependencies
run: |
pip install pyinstaller
pip install pyinstaller music_tag jibrish_to_hebrew
- name: Build EXE
run: |
pyinstaller --onefile --add-data "src\core\app\singer-list.csv;app" your_cli_script.py
pyinstaller --onefile --add-data "src/core/app/singer-list.csv;app" --name "Singles-Sorter" --icon "src/core/assets/icon.ico" "src/core/singles_sorter_v3.py"
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}

- name: Rename output file
run: |
move dist\your_cli_script.exe dist\singles-sorter-cli-${{ steps.get_version.outputs.VERSION }}.exe
move dist\Singles-Sorter.exe dist\Singles-Sorter-cli-${{ steps.get_version.outputs.VERSION }}.exe
- name: Create Release
id: create_release
Expand All @@ -42,8 +42,8 @@ jobs:
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
draft: true
prerelease: true

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Publish EXE

on:
push:
branches:
- gui
tags:
- 'v*'

jobs:
build:
Expand All @@ -20,7 +20,7 @@ jobs:

- name: Install dependencies
run: |
pip install pyinstaller music_tag jibrish_to_hebrew flet
pip install pyinstaller music_tag jibrish_to_hebrew flet==0.22.0
- name: Build EXE
run: |
Expand Down
4 changes: 2 additions & 2 deletions src/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import os

# קבצי התוכנה
from singles_sorter_v3 import MusicSorter
from singles_sorter_v3 import MusicSorter, __VERSION__
from general_configs import check_for_update, load_config, save_config


# גרסת התוכנה
global VERSION
VERSION = MusicSorter.VERSION
VERSION = __VERSION__



Expand Down
17 changes: 13 additions & 4 deletions src/core/singles_sorter_v3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-
__VERSION__ = '13.0'

import os
import sys
import argparse
from shutil import copy, move
from music_tag import load_file
Expand All @@ -11,8 +14,6 @@

class MusicSorter:

VERSION = '13.0'

def __init__(self, source_dir, target_dir, copy_mode=False, abc_sort=False, exist_only=False, singles_folder=True, main_folder_only=False, progress_callback=None):
self.unusual_list = ["סינגלים", "סינגל", "אבגדהוזחטיכלמנסעפצקרשתךםןץ", "אמן לא ידוע", "טוב", "לא ידוע", "תודה לך ה"]
self.substrings_to_remove = [" -מייל מיוזיק", " - ציצו במייל", "-חדשות המוזיקה", " - חדשות המוזיקה", " - ציצו", " מוזיקה מכל הלב", " - מייל מיוזיק"]
Expand Down Expand Up @@ -195,7 +196,15 @@ def scan_dir(self):
def list_from_csv(self):
# יבוא רשימת זמרים מקובץ csv
# Construct the path to the CSV file
csv_path = os.path.abspath("app/singer-list.csv")

# אם הקוד רץ כקובץ מקומפל
if getattr(sys, 'frozen', False):
csv_path = os.path.join(sys._MEIPASS, 'app', 'singer-list.csv')
else:
# אם הקוד רץ כסקריפט רגיל
csv_path = os.path.abspath("app/singer-list.csv")



with open(csv_path, 'r', encoding='utf-8') as file:
csv_reader = csv.reader(file)
Expand Down Expand Up @@ -347,7 +356,7 @@ def load_from_log(self, log_filename):


def main():
parser = argparse.ArgumentParser(description=f"Singles Sorter {MusicSorter.VERSION} - Scan and organize music files into folders by artist using advanced automation.")
parser = argparse.ArgumentParser(description=f"Singles Sorter {__VERSION__} - Scan and organize music files into folders by artist using advanced automation.")
parser.add_argument('source_dir', help="Path to the source directory")
parser.add_argument('target_dir', help="Path to the target directory", nargs='?')
parser.add_argument('-c', '--copy_mode', help="Enable copy mode (default is move mode)", action='store_true')
Expand Down

0 comments on commit 594ea77

Please sign in to comment.