Skip to content

Commit

Permalink
Merge pull request #661 from jb-alvarado/master
Browse files Browse the repository at this point in the history
 correct save absolut path, improve infinit mode, fix #643
  • Loading branch information
jb-alvarado committed May 15, 2024
2 parents e691522 + 8bb2e96 commit e35b512
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default-members = ["ffplayout-api", "ffplayout-engine", "tests"]
resolver = "2"

[workspace.package]
version = "0.22.2"
version = "0.22.3"
license = "GPL-3.0"
repository = "https://github.com/ffplayout/ffplayout"
authors = ["Jonathan Baecker <jonbae77@gmail.com>"]
Expand Down
4 changes: 2 additions & 2 deletions assets/ffplayout.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ help_text = """'filler' is for playing instead of a missing file or fill the end
to pick files randomly."""
path = "/var/lib/ffplayout/tv-media"
filler = "/var/lib/ffplayout/tv-media/filler/filler.mp4"
extensions = ["mp4", "mkv"]
extensions = ["mp4", "mkv", "webm"]
shuffle = true

[text]
Expand All @@ -131,7 +131,7 @@ add_text = true
text_from_filename = false
fontfile = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
style = "x=(w-tw)/2:y=(h-line_h)*0.9:fontsize=24:fontcolor=#ffffff:box=1:boxcolor=#000000:boxborderw=4"
regex = "^.+[/\\](.*)(.mp4|.mkv)$"
regex = "^.+[/\\](.*)(.mp4|.mkv|.webm)$"

[task]
help_text = """Run an external program with a given media object. The media object is in json format \
Expand Down
21 changes: 15 additions & 6 deletions ffplayout-api/src/utils/playlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,22 @@ pub async fn write_playlist(
) -> Result<String, ServiceError> {
let (config, _) = playout_config(conn, &id).await?;
let date = json_data.date.clone();
let mut playlist_path = PathBuf::from(&config.playlist.path);
let mut playlist_path = config.playlist.path;
let d: Vec<&str> = date.split('-').collect();
playlist_path = playlist_path
.join(d[0])
.join(d[1])
.join(date.clone())
.with_extension("json");

if !playlist_path
.extension()
.and_then(|ext| ext.to_str())
.map(|ext| ext.eq_ignore_ascii_case("json"))
.unwrap_or(false)
{
playlist_path = playlist_path
.join(d[0])
.join(d[1])
.join(date.clone())
.with_extension("json");
}

let mut file_exists = false;

if let Some(p) = playlist_path.parent() {
Expand Down

0 comments on commit e35b512

Please sign in to comment.