Skip to content

Commit

Permalink
Specify Audio MediaStreams (Taiko2k#1182)
Browse files Browse the repository at this point in the history
* Specify Audio MediaStreams

* spelling fixes
octoamit authored Jul 11, 2024
1 parent 232944f commit 085ce32
Showing 2 changed files with 19 additions and 16 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@ Wanna contribute? Theres a few ways you can:

## Questions

You feel free to ask questions as a new Github issue. Please do not comment in an existing or old issue unless you're the author or you're sure its directly releated.
You feel free to ask questions as a new Github issue. Please do not comment in an existing or old issue unless you're the author or you're sure its directly related.

You can also use the github discussions feature.
You can also use the github discussions feature.

If you use Discord it may be faster to ask on the official server.

@@ -23,7 +23,7 @@ If you encounter an issue, feel free to create new issues on github.
- What method did you use to install Tauon?
- Flatpak? Snap? AUR? Other/Manual?
- What version number is shown under MENU > Settings... > About
- For audio/transition related issues, what backend do you have selected under MENU > Settings... > Audio. Does the issue happen on both backends? Are you playing local files, or files from a particuar network server?
- For audio/transition related issues, what backend do you have selected under MENU > Settings... > Audio. Does the issue happen on both backends? Are you playing local files, or files from a particular network server?
- For crashes, it would be most helpful if you could replicate the crash and capture the error from terminal output.
- To run manually for AUR install: `tauon`. For Flatpak: `flatpak run com.github.taiko2k.tauonmb`

@@ -36,7 +36,7 @@ Design concepts would be interesting to see, but you should check with me before

## Code Contributions

The code base for core and UI related elements is very (very) messy, and there are strict design requiements, as such I don't expect code contributions for these things.
The code base for core and UI related elements is very (very) messy, and there are strict design requirements, as such I don't expect code contributions for these things.

Tauon's submodules are more manageable to work on.

27 changes: 15 additions & 12 deletions t_modules/t_jellyfin.py
Original file line number Diff line number Diff line change
@@ -388,7 +388,7 @@ def ingest_library(self, return_list=False):
params={
"userId": self.userId,
"fields": ["Genres","DateCreated","MediaSources","People"],
"enableImages": 'false',
"enableImages": False,
"mediaTypes": ["Audio"],
"recursive": True,
},
@@ -456,24 +456,27 @@ def ingest_library(self, return_list=False):
for d in track.get("People", [])
if d["Type"] == "Composer")
nt.length = track.get("RunTimeTicks", 0) / 10000000 # needs to be in seconds
nt.bitrate = round((track.get("MediaSources")[0]
["MediaStreams"][0]["BitRate"] / 1000))
nt.samplerate = round((track.get("MediaSources")[0]
["MediaStreams"][0].get("SampleRate", 0)))
nt.bit_depth = (track.get("MediaSources")[0]
["MediaStreams"][0].get("BitDepth", 0))
nt.album = track.get("Album", "")
nt.date = str(track.get("ProductionYear"))
nt.date = str(track.get("ProductionYear", ""))
nt.track_number = str(track.get("IndexNumber", ""))
genres = track.get("Genres", [])
nt.genre = "; ".join(genres)
nt.comment = (track.get("MediaSources")[0]
["MediaStreams"][0].get("Comment", ""))
nt.disc_number = str(track.get("ParentIndexNumber", ""))

try:
nt.misc["container"] = track.get("MediaSources")[0]["Container"].upper()
nt.misc["codec"] = track.get("MediaSources")[0]["MediaStreams"][0]["Codec"]
for d in track.get("MediaSources")[0]["MediaStreams"]:
if d["Type"] == "Audio":
nt.bitrate = round(d.get("BitRate", 0) / 1000)
nt.samplerate = round(d.get("SampleRate", 0))
nt.bit_depth = d.get("BitDepth", 0)
nt.comment = d.get("Comment", "")
nt.misc["codec"] = d.get("Codec", "")
break
except:
print("Jelly error getting audio mediastream")

try:
nt.misc["container"] = track.get("MediaSources")[0].get("Container", "").upper()
except:
print("Jelly error get container")

0 comments on commit 085ce32

Please sign in to comment.