Skip to content

Commit

Permalink
even more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
cdgriffith committed Aug 14, 2024
1 parent 148eafd commit 37239d6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
LICENSE
- name: Upload installer artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: FastFlix_${{ env.VERSION }}_installer
path: FastFlix_${{ env.VERSION }}_installer.exe
2 changes: 1 addition & 1 deletion fastflix/encoders/common/encc_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def rigaya_avformat_reader(fastflix: FastFlix) -> str:
# y4m reader y4m
# raw reader yuv
# avhw/avsw reader others
ending = fastflix.current_video.source.suffix
ending = fastflix.current_video.source_path.suffix
if fastflix.current_video.video_settings.video_encoder_settings.decoder not in ("Hardware", "Software"):
if ending.lower() in (".avs", ".vpy", ".avi", ".y4m", ".yuv"):
return ""
Expand Down
4 changes: 2 additions & 2 deletions fastflix/flix.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def get_concat_item(file, location=0):


def parse(app: FastFlixApp, **_):
source = app.fastflix.current_video.source
source = app.fastflix.current_video.source_path
if source.name.lower().endswith("txt"):
source = get_concat_item(source)
app.fastflix.current_video.concat = True
Expand Down Expand Up @@ -293,7 +293,7 @@ def extract_attachments(app: FastFlixApp, **_):
if filename.rsplit(".", 1)[0] in ("cover", "small_cover", "cover_land", "small_cover_land"):
extract_attachment(
app.fastflix.config.ffmpeg,
app.fastflix.current_video.source,
app.fastflix.current_video.source_path,
track.index,
app.fastflix.current_video.work_path,
filename,
Expand Down
14 changes: 9 additions & 5 deletions fastflix/models/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def clear(self):


class Video(BaseModel):
source: Path
source: str
duration: Union[float, int] = 0
streams: Box = None

Expand All @@ -216,9 +216,11 @@ class Video(BaseModel):

@field_validator("source", mode="before")
@classmethod
def source_to_path(cls, value):
def source_to_str(cls, value):
if not isinstance(value, str):
value = str(value)

if "\\ " in str(value):
if "\\ " in value:
logger.error(f"Invalid source path: {value}")
import inspect

Expand All @@ -227,10 +229,12 @@ def source_to_path(cls, value):
continue
logger.debug(stack)

if not isinstance(value, Path):
return Path(value)
return value

@property
def source_path(self) -> Path:
return Path(self.source)

@property
def width(self):
track = 0
Expand Down
6 changes: 5 additions & 1 deletion fastflix/widgets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,11 @@ def open_file(self):
"Concatenation Text File (*.txt *.concat);; All Files (*)",
dir=str(
self.app.fastflix.config.source_directory
or (self.app.fastflix.current_video.source.parent if self.app.fastflix.current_video else Path.home())
or (
self.app.fastflix.current_video.source_path.parent
if self.app.fastflix.current_video
else Path.home()
)
),
)
if not filename or not filename[0]:
Expand Down
6 changes: 0 additions & 6 deletions fastflix/widgets/panels/queue_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,17 +539,11 @@ def add_to_queue(self):
for video in self.app.fastflix.conversion_list:
if video.status.complete:
continue
if self.app.fastflix.current_video.source == video.source:
source_in_queue = True
if self.app.fastflix.current_video.video_settings.output_path == video.video_settings.output_path:
raise FastFlixInternalException(
f"{video.video_settings.output_path} {t('out file is already in queue')}"
)

# if source_in_queue:
# TODO ask if ok
# return

self.app.fastflix.conversion_list.append(copy.deepcopy(self.app.fastflix.current_video))
self.new_source()
save_queue(self.app.fastflix.conversion_list, self.app.fastflix.queue_path, self.app.fastflix.config)
Expand Down

0 comments on commit 37239d6

Please sign in to comment.