Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add playback success + update css purecss + reorder columns + update crystal version #44

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Crystal
uses: oprypin/install-crystal@v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: oprypin/install-crystal@v1
uses: crystal-lang/install-crystal@v1.8.1

with:
crystal: 1.0.0
crystal: 1.10.1

- name: Cache Shards
uses: actions/cache@v2
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM docker.io/crystallang/crystal:1.0.0-alpine AS builder
FROM crystallang/crystal:1.10.1-alpine AS builder
WORKDIR /app
COPY ./shard.yml ./shard.yml
RUN shards install
COPY ./src/ ./src/
RUN crystal build ./src/instances.cr --release

FROM alpine:latest
RUN apk add --no-cache gc pcre libgcc
FROM alpine:3.18
RUN apk add --no-cache gc pcre2 libgcc
WORKDIR /app
RUN addgroup -g 1000 -S invidious && \
adduser -u 1000 -S invidious -G invidious
Expand Down
8 changes: 4 additions & 4 deletions assets/css/base-min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assets/css/tables-min.css

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

10 changes: 3 additions & 7 deletions shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ version: 2.0
shards:
backtracer:
git: https://github.com/sija/backtracer.cr.git
version: 1.2.1
version: 1.2.2

exception_page:
git: https://github.com/crystal-loot/exception_page.git
version: 0.2.0
version: 0.3.1

kemal:
git: https://github.com/kemalcr/kemal.git
version: 1.0.0+git.commit.218be2422172d330feb62c6a8abc7df5402fdb84

kilt:
git: https://github.com/jeromegn/kilt.git
version: 0.6.1
version: 1.4.0

radix:
git: https://github.com/luislavena/radix.git
Expand Down
7 changes: 4 additions & 3 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: instances
version: 0.1.0
version: 0.2.0

authors:
- Omar Roth <[email protected]>
- Invidious team

targets:
instances:
Expand All @@ -11,8 +12,8 @@ targets:
dependencies:
kemal:
github: kemalcr/kemal
branch: master
version: ~> 1.4.0

crystal: 1.0.0
crystal: 1.10.1

license: AGPLv3
1 change: 1 addition & 0 deletions src/instances.cr
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ SORT_PROCS = {
"api" => ->(name : String, instance : Instance) { instance[:api] == nil ? 2 : instance[:api] ? 0 : 1 },
"users" => ->(name : String, instance : Instance) { -(instance[:stats]?.try &.["usage"]?.try &.["users"]["total"].as_i || 0) },
"version" => ->(name : String, instance : Instance) { instance[:stats]?.try &.["software"]?.try &.["version"].as_s.try &.split("-", 2)[0].split(".").map { |a| -a.to_i } || [0, 0, 0] },
"playback" => ->(name : String, instance : Instance) { -(instance[:stats]?.try &.["playback"]?.try &.["ratio"]?.try { |ratio| ratio.as_f } || 0.0) },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about latching onto the previous (populated) playback success statistics so that we mostly won't get an empty playback stats data?

}

def sort_instances(instances, sort_by)
Expand Down
Loading