mirror of
https://github.com/tubearchivist/tubearchivist-jf-plugin.git
synced 2026-03-23 20:37:14 +00:00
[GH-ISSUE #1] [Bug]: Certain descriptions do not handle newline replacements properly #1
Labels
No labels
bug
enhancement
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tubearchivist/archived-tubearchivist-jf-plugin#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lamusmaser on GitHub (Apr 18, 2024).
Original GitHub issue: https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/1
Originally assigned to: @DarkFighterLuke on GitHub.
As reported in Discord by user @__hetz, there are certain descriptions that are unable to handle newline replacements properly. This seems to be because the
<br>tags that are coming in are not being processed correctly, and so they are being seen as open-ended tags that require a closure tag.This causes the description and rendering of the page to become very distorted and unable to show the video preview properly.
@lamusmaser commented on GitHub (Apr 18, 2024):
As discussed in Discord, this could be remedied with several types of handling.
<br>-><br></br><br>-><br />This does seem to only be happening on certain browsers/renderings of Jellyfin, The others are handling the break lines properly. Additionally, these were working within the
tubearchivist-jffunctionality, which was copied over into this. This means that there was an additional post-processor that was handling the occurrences of break lines as they were being rendered, since they were being imported straight through via the Jellyfin API.@ThisIsHetz commented on GitHub (Apr 18, 2024):
I dug up the password for this old account just to chime in.
This issue impacted the Jellyfin app for Android, the latest Windows desktop client (running on Windows 11), as well as the Jellyfin web interface in both the latest Brave and Firefox web browsers (again on Windows 11). The only exception was with an unofficial build of the Jellyfin app for Samsung televisions running Tizen OS. To spare a tangent, I don't have the details for the Tizen app but I believe it is based off an older Android app build and that it was a fluke that it happened to display correctly.
I'm also uncertain there was any additional post-processing. Rather it has to do with the order of operations when the video description is processed from JSON to HTML for Jellyfin. With the old extension, newlines were replaced with HTML breaks only after the description was truncated:
With this plugin the truncation occurs after the newlines are replaced:
When truncation occurs it sometimes leaves an incomplete HTML break (e.g.
<bor<br) at the end of a video description which is what breaks the display of video lists. My temporary fix was to separate the two operations such that they behave as the previous extension did:As an aside, it may be worth noting that neither the previous extension nor my solution probably abides by the character limit since two characters are going to be gained each time a
\nis replaced with a<br>.@DarkFighterLuke commented on GitHub (Apr 18, 2024):
Hello guys, the fix proposed by @ThisIsHetz has been merged and a new release is now available.
Thanks for the contribution!