Skip to content

Commit

Permalink
fix parsing type and orient attributes (#28)
Browse files Browse the repository at this point in the history
* fix parsing type and orient attributes

* lint

* bump version
  • Loading branch information
blazpie authored Jan 11, 2023
1 parent 8fbe885 commit ef1f434
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/ex_sdp/attribute.ex
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,18 @@ defmodule ExSDP.Attribute do

defp parse_orient(orient) do
case orient do
string when string in ["portrait", "landscape", "seascape"] -> String.to_atom(string)
_invalid_orient -> {:error, :invalid_orient}
string when string in ["portrait", "landscape", "seascape"] ->
{:ok, {:orient, String.to_atom(string)}}

_invalid_orient ->
{:error, :invalid_orient}
end
end

defp parse_type(type) do
case type do
string when string in ["broadcast", "meeting", "moderated", "test", "H332"] ->
String.to_atom(string)
{:ok, {:type, String.to_atom(string)}}

_invalid_type ->
{:error, :invalid_type}
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule ExSDP.MixProject do
use Mix.Project

@version "0.10.0"
@version "0.10.1"
@github_url "https://github.com/membraneframework/ex_sdp"

def project do
Expand Down

0 comments on commit ef1f434

Please sign in to comment.