Skip to content

Commit cb6e6f9

Browse files
committed
release v1.0.28
1 parent a02daee commit cb6e6f9

5 files changed

Lines changed: 41 additions & 19 deletions

File tree

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
+--------------------------------+
2+
June 14 2025 Version 1.0.28
3+
+--------------------------------+
4+
5+
- Improving functionalities
6+
- code refactor
7+
18
+--------------------------------+
29
June 12 2025 Version 1.0.27
310
+--------------------------------+

ffcuesplitter/about.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
CONTACT = '<jeanlucperni@gmail.com>'
2727
MAINTAINER = "Gianluca Pernigotto - Jeanslack"
2828
COPYLEFT = '2025'
29-
VERSION = '1.0.27'
30-
RELEASE = 'June 12 2025'
29+
VERSION = '1.0.28'
30+
RELEASE = 'June 14 2025'
3131
APPNAME = "FFcuesplitter"
3232
PKGNAME = "ffcuesplitter"
3333
LICENSE_NAME = "GPL3 (Gnu Public License)"

ffcuesplitter/cuesplitter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Writer: jeanslack <jeanlucperni@gmail.com>
88
license: GPL3
99
Copyleft: (C) 2025 Gianluca Pernigotto <jeanlucperni@gmail.com>
10-
Rev: June 10 2025
10+
Rev: June 14 2025
1111
Code checker: flake8 and pylint
1212
####################################################################
1313
@@ -238,13 +238,14 @@ def deflacue_object_handler(self):
238238
track_file = track[1].file.path
239239

240240
if not track_file.exists():
241-
logging.warning('Not found: `%s`. Track is skipped.',
241+
logging.warning('Not found: "%s"',
242242
os.path.abspath(track_file))
243243

244244
if str(track_file) in sourcenames:
245245
sourcenames.pop(str(track_file))
246246
if not sourcenames:
247-
raise FFCueSplitterError('No audio files found!')
247+
raise FFCueSplitterError(f'No audio track found: '
248+
f'«{track_file}»')
248249
continue
249250

250251
data = {'FILE': str(track_file), **cd_info, **track[1].data}

ffcuesplitter/user_service.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import logging
3333
from ffcuesplitter.cuesplitter import FFCueSplitter
3434
from ffcuesplitter.exceptions import FFCueSplitterError
35+
from ffcuesplitter.utils import remove_source_file
3536

3637

3738
class FileSystemOperations(FFCueSplitter):
@@ -61,7 +62,7 @@ class FileSystemOperations(FFCueSplitter):
6162
"""
6263
# ----------------------------------------------------------------#
6364

64-
def remove_source_file(self):
65+
def del_orig_files(self):
6566
"""
6667
Remove the CUE file and the original audio file
6768
from the filesystem. If either one is missing, no
@@ -70,18 +71,12 @@ def remove_source_file(self):
7071
"""
7172
cuef = self.kwargs['filename']
7273
audf = self.audiosource
73-
exist = False
74-
if os.path.exists(cuef) and os.path.exists(audf):
75-
if os.path.isfile(cuef) and os.path.isfile(audf):
76-
exist = True
77-
logging.info("Deleting CUE file: '%s'", cuef)
78-
os.remove(cuef)
79-
logging.info("Deleting audio source file: '%s'", audf)
80-
os.remove(audf)
81-
if not exist:
74+
ret = remove_source_file(cuef, audf)
75+
if ret is True:
76+
logging.info("Deleting CUE file: '%s'", cuef)
77+
logging.info("Deleting audio source file: '%s'", audf)
78+
else:
8279
logging.warning("File deletion failed, source files are missing")
83-
return exist
84-
return exist
8580
# ----------------------------------------------------------------#
8681

8782
def dry_run_mode(self):
@@ -205,7 +200,8 @@ def work_on_temporary_directory(self):
205200
self.move_files_to_outputdir()
206201
# remove source file if `del_orig_files` argument is given.
207202
if self.kwargs['del_orig_files']:
208-
self.remove_source_file()
203+
#self.remove_source_file()
204+
self.del_orig_files()
209205
# ------------------------------------------------------------------------
210206

211207

ffcuesplitter/utils.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Writer: jeanslack <jeanlucperni@gmail.com>
66
license: GPL3
77
Copyleft: (C) 2025 Gianluca Pernigotto <jeanlucperni@gmail.com>
8-
Rev: June 10 2025
8+
Rev: June 14 2025
99
Code checker: flake8 and pylint
1010
####################################################################
1111
@@ -108,6 +108,24 @@ def makeoutputdirs(outputdir):
108108
# ------------------------------------------------------------------------
109109

110110

111+
def remove_source_file(cuef, audf):
112+
"""
113+
Remove the CUE file and the original audio file
114+
from the filesystem. If either one is missing, no
115+
deletion will be applied.
116+
Return True if deletion was successfull, False otherwise.
117+
"""
118+
if os.path.exists(cuef) and os.path.exists(audf):
119+
if os.path.isfile(cuef) and os.path.isfile(audf):
120+
os.remove(cuef)
121+
os.remove(audf)
122+
return True
123+
else:
124+
return False
125+
return False
126+
# ------------------------------------------------------------------------
127+
128+
111129
class Popen(subprocess.Popen):
112130
"""
113131
Inherit `subprocess.Popen` class to set `_startupinfo`.

0 commit comments

Comments
 (0)