Commit Graph

122 Commits

Author SHA1 Message Date
Christian Benincasa
83126c8659 fix: fix channel deletes when channel is associated with fillers (#889) 2024-10-18 12:31:05 -04:00
Christian Benincasa
663a849be8 chore(dev): release 0.13.2 (#875) 2024-10-17 16:48:01 -04:00
Christian Benincasa
a57a4f0e76 chore(dev): release 0.13.1 (#868) 2024-10-15 07:48:22 -04:00
Christian Benincasa
ec02141903 chore(dev): release 0.13.0 (#857) 2024-10-15 07:08:01 -04:00
Christian Benincasa
1e50a837cd feat: improved grid view with alphanumeric quick filter (#832)
Many speed and UX improvements to the program selector grid view,
including:

* more eagerly loading items in the grid - makes the intersection
  observer more eager
* faster fade in of images - the old 750ms fade was smooth but
  gave the illusion of slowness
* send cache-control headers for proxied Plex thumbs in
  production builds
* increases frontend query cache time for plex and jellyfin
  searches in tanstack query
* implements filtering by first letter items in both plex and
  jellyfin
* set the grid container height to the absolute max of all grid
  items to allow for smoother scroll
* removes some unnecessary re-renders
* adds an alphanumeric quick filter for easily jumping to programs that
  start with a specific character
2024-10-14 15:56:48 -04:00
Christian Benincasa
c95371e58d chore: bump a bunch of version 2024-10-11 13:42:57 -04:00
Christian Benincasa
202df1780c chore: fix macos binary release 2024-10-10 20:41:39 -04:00
Christian Benincasa
43e38d3d4a chore: remove unused deps from server 2024-10-10 07:54:01 -04:00
Christian Benincasa
a175f05be7 chore(dev): release 0.12.4 (#840) 2024-10-09 13:02:17 -04:00
Christian Benincasa
d83113bbaa fix: remove eventual consistency for program_grouping upserts (#843)
Now that we are fully relying on our own internal DB relations for
program hierarchies (shows, seasons, albums, artists), we cannot use
eventual consistency for saving these relations when upserting programs.
This creates issues like #825, when sometimes groupings aren't fully
available after successfully creating a lineup.

This includes the following changes to speed things up and synchronously
save program_groupings:

* Completely remove usages of mikro-orm on the upsert programs path.
  Everything is handled by lower level query builders via kysely
* Save program_grouping and critical program_grouping_external_ids with
  immediate consistency
* Defer saving PLEX_GUID type external IDs to the background
* Properly defer saving non-critical external IDs until after the
  request is returned
* Stop validating requests/responses client-side via Zod. The backend
  already does this so we were duplicating work here and slowing things
down considerably.
* Moves upsertContentPrograms to ProgramDB
* Removes kysely types that were generated with kysely-codegen because
  it oversimplified all underlying DB types

Fixes #825
2024-10-09 12:50:45 -04:00
Christian Benincasa
6007f50e39 chore(dev): release 0.12.3 (#822) 2024-10-02 22:07:07 -04:00
Christian Benincasa
ea1558f533 chore(dev): release 0.12.2 (#817) 2024-09-30 18:03:23 -04:00
Christian Benincasa
fdb802893b chore: write plaintext logs to file instead of json
Fixes: #807
2024-09-30 12:36:06 -04:00
Christian Benincasa
a105f8a319 chore(dev): release 0.12.1 (#815) 2024-09-30 12:21:41 -04:00
Christian Benincasa
4229fb9cc0 chore(dev): release 0.12.0 (#797) 2024-09-27 14:04:26 -04:00
Christian Benincasa
ecaddb5c4c fix: attempts to improve stream stability for mpegts streams (#801)
Fixes include:
1. adding some reconnection retry parameters to the ffmpeg input arg
   list
2. fast-kill concat streams on final disconnect

Also added the ability to generate ffreport files in the UI, with
customizable ffmpeg loglevel.
2024-09-25 13:01:56 -04:00
Christian Benincasa
6e66cfe2f0 feat: introduce new default HLS stream mode (#780)
This commit introduces a new HLS stream mode, modeled off of the great
"HLS segmenter" in ErsatzTV. It also introduces the concept of "channel
stream modes" which are customizable in the UI.

Overall this commit performs a ton of refactoring and cleanup around the
streaming pipeline, consolidating a lot of logic and moving things
around to make all parts of it more flexible, understandable, and
extensible in the future.
2024-09-24 10:28:37 -04:00
Christian Benincasa
31abb94ba0 chore(dev): release 0.11.0 (#790) 2024-09-23 16:03:10 -04:00
Christian Benincasa
80c71d2cf8 chore(dev): release 0.10.4 2024-09-21 14:19:54 -04:00
Christian Benincasa
79005d831b chore: ditch nexe; opt for just packaing node version and our runner script 2024-09-21 14:00:18 -04:00
Christian Benincasa
7c3dac761c chore(dev): release 0.10.3 2024-09-13 13:52:39 -04:00
Christian Benincasa
a85efbb2ea chore(dev): release 0.10.2 2024-09-12 17:50:53 -04:00
Christian Benincasa
1e3f1ab9e0 chore(dev): release 0.10.1 2024-09-12 11:07:23 -04:00
Christian Benincasa
4f77daa462 chore(dev): release 0.10.0 2024-09-10 13:04:25 -04:00
Christian Benincasa
7c05f3599f chore: fix dep graph for new types build
also fixes clean tasks
2024-09-10 10:26:51 -04:00
Christian Benincasa
5ef1fc8bb8 feat: major streaming overhaul (#749)
This commit features a major rewrite and refactoring of the streaming
pipeline and class hierachy in Tunarr. It introduces new default
streaming modes in an attempt to stabilize transitions between program
streams, reuse underlying resources (e.g. ffmpeg processes), reduce the
complexity of interaction between various streaming class components,
and increase flexibility for future development.

Some notable changes:
* The default MPEG-TS stream is now backed by HLS. IPTV and Web
  streaming sessions are shared
* Transcode readahead implementation. This should create smoother
  streams. For FFMPEG 7 (and future versions) we use the native
  "readrate_initial_burst" option. For earlier versions we use an
  artificial readahead. **NOTE**: FFMPEG <7 artificial readahead might
  have unintended side effects (e.g. loudness normalization issues) and
  as such FFMPEG 7+ is recommended
* Separation between building an ffmpeg process, spawning the process,
  and the notion of a 'transcode session'. These are all separate
  classes now with narrow concerns
* Other misc refactoring to cleanup code and remove leftover superfluous
  logic from DTV
2024-09-06 14:44:50 -04:00
Christian Benincasa
4db5d9a6aa chore(dev): release 0.9.1 (#740) 2024-09-02 14:46:36 -04:00
Christian Benincasa
d5bd395daa chore(dev): release 0.9.0 (#724) 2024-08-29 15:10:29 -04:00
Christian Benincasa
c796598784 chore(dev): release 0.8.1 (#717) 2024-08-26 08:47:29 -04:00
Christian Benincasa
81695f22f5 chore(dev): release 0.8.0 (#698) 2024-08-25 07:37:30 -04:00
Christian Benincasa
f52df44ef0 feat!: add support for Jellyfin media (#633)
This commit includes a huge amount of changes, including support for
adding Jellyfin servers as media sources and streaming content from
them.

These are breaking changes and touch almost every corner of the code,
but also pave the way for a lot more flexibility on the backend for
addinng different sources.

The commit also includes performance improvements to the inline modal,
lots of code cleanup, and a few bug fixes I found along the way.

Fixes #24
2024-08-22 07:41:33 -04:00
Christian Benincasa
69b14fc387 chore(dev): release 0.7.0 (#695) 2024-08-21 18:30:35 -04:00
Christian Benincasa
1ac7b49ba0 chore: bump vite version to 5.4.1 (#685) 2024-08-21 08:11:10 -04:00
Christian Benincasa
6d2e58f289 chore(dev): release 0.6.0 (#691) 2024-08-19 09:28:36 -04:00
Christian Benincasa
c385946800 chore(dev): release 0.5.4 (#681) 2024-08-18 10:30:54 -04:00
Christian Benincasa
bed7396b6f chore(dev): release 0.5.3 (#675) 2024-08-12 22:51:32 -04:00
Christian Benincasa
b98a856ffa chore(dev): release 0.5.2 (#664) 2024-08-05 20:37:41 -04:00
Christian Benincasa
a8d1bcacfc chore(dev): release 0.5.1 (#659) 2024-08-05 07:22:42 -04:00
Christian Benincasa
31ed587277 chore(dev): release 0.5.0 (#654) 2024-08-04 14:31:18 -04:00
Christian Benincasa
3595237631 chore(dev): release tunarr 0.4.2 (#651) 2024-08-04 11:06:13 -04:00
Christian Benincasa
c2d5a667b5 feat: add ARM builds (#618) 2024-07-16 13:19:08 -04:00
Christian Benincasa
13fe5043ff feat: implement on-demand channels (#613)
Implements Tunarr's version of DizqueTV's "on-demand channels" per the
outline in #612.

Closes #612
2024-07-14 07:22:35 -04:00
Christian Benincasa
8b8f6f894d fix: workaround for macOS binary release (#608)
Fixes #599

Due to multiple issues surrounding single executable generation for
macOS, including issues with code signing due to executable mangling
(necessary when using Nexe with binary resources, i.e. the Tunarr
webapp), it seems the simplest solution is to simply bundle the relevant
version of nodejs itself along with a simple script to run Tunarr.

This essentially mimics the inside of our Docker containers and, in a
way, how the bundled executable works too... it's a little gnarly, but
it seems to work.
2024-07-10 11:53:34 -04:00
Christian Benincasa
bf4250df22 chore: add changesets initial config 2024-07-08 13:20:12 -04:00
Christian Benincasa
4d462d7883 Bump versions everywhere - we're gonna need a better way to do this 2024-07-08 09:47:09 -04:00
Christian Benincasa
bc376eec97 Dynamic channels, part 2 (#562)
* Dynamic channels, part 2

* Checkpoint - not sure how are going to handle programming rules that rely on the channel start time yet

* lots more...this is gonna be cool

* Implement scheduled redirect tool on backend

* Have to scale offsets on each addition of a scheduled redirect

* Implement offline collapse internal operation

* Lots more dynamic channel goodies. We're getting closer

* Thinking about how to do operators that need metadata

* Kysely - make it fast...
2024-06-27 11:35:54 -04:00
Christian Benincasa
bc17560563 Fix Mac OS executable bundling + remove unused deps (#565) 2024-06-25 06:38:51 -04:00
Christian Benincasa
c62b1bf40b Tons of potential performance improvements to lineup retrieval/updating (#552)
Includes:
* Batching inserts to external IDs
* Only saving critical external IDs (plex rating key) synchronously on
  lineup update. Non-critical external ID inserts are pushed to
  background tasks
* Program grouping / hierarchy updating has been pushed to a background
  task
* Optimized verison of content program converter function that is
  synchronous. This is much more performant for 1000s of items,
  specifically when no async actions (selecting extra data) is
  necessary. We saw a ~89% reduction in time spent here (>1s to ~30ms)
* A few places were selecting all channel programs when they only needed
  to select the channel
* Only select program IDs at the outset of lineup update, instead of all
  program details. We only need the IDs for relation diffing

Still some things we haven't solved:

1. There is non-trivial overhead in the mikro-orm ORM framework to
   mapping 1000s of selected entities. In a 2k program channel case,
   when loading all necessary entities (relations), we can see ~6k
   entities loaded by the framework. The select from the DB only takes
   about 800ms, but the entity mapping step can take >3s in this case.
   One solution here is to use a simpler library for these super large
   selects (kysely?)
2. It's probably overkill to have both Zodios on the client and then Zod
   checking incoming types on the server. On huge request, this can add
   ~100ms or more (server side) to requests as Zod validates incoming
   requests against the schema
3. We should think about replacing Zod on the server side with JSON
   Schema. There are converters out there. We have a lot invested in
   Zod, so a converter would be a good first step.
4. There's clearly some I/O contention happening in certain situations
   ... background tasks that query DB or Plex, getting responses to flow, logging, etc. I think most of it is DB-related.
5. Unclear if there is any actually _fast_ way to insert the amount of
   data we are currently generating for large channels.
2024-06-22 08:30:38 -04:00
Christian Benincasa
8c5e462f89 Removes swagger-ui Fastify plugin, hopefully temporarily (#551)
We've seen reports like
https://github.com/chrisbenincasa/tunarr/issues/550 where swagger-ui
prevents the server from starting, permanently. I haven't been able to
reproduce this yet. We've opened an issue on the plugin repo to see if
they have ideas:
https://github.com/fastify/fastify-swagger-ui/issues/156

For now, we're not really in need of this anyway, so just remove it.

I've also updated a bunch of deps and shimmed in the "DOM" types in our
tsconfig since there are lots of errors when compiling during the lib
check phase for things like esbuild, vitest.
2024-06-22 07:56:50 -04:00
Christian Benincasa
faf16a9fd5 Update swagger-ui version 2024-06-22 07:53:58 -04:00