mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-24 08:28:27 -04:00
* initial ffprobe commit * Working slim down version ffprobe * Auto format ffprobe and deps source * Remove show_pixel_formats logic - Fix do_bitexact incorrect check in main after last changes - Fix some clangd warning * Remove show_* and print_format options and their respective logic * Rework ffprobe into simple_ffprobe - Simplify ffprobe logic into a simple program that gather and print a media file metadata * Reduce the amount of ffmpeg log messages while generating thumbnails * Fix completly wrong comments * mend * Start modeling ffmpeg extracted metadata on schema - Start porting ffprobe code to rust - Rename some references to media_data to exif_data * Finish modeling media info data - Add MediaProgram, MediaStream, MediaCodec, MediaVideoProps, MediaAudioProps, MediaSubtitleProps to Schema - Fix simple_ffproble to use its custom print_codec, instead of ffmpeg's impl * Add relation between MediaInfo and FilePath - Remove shared properties from MediaInfo and related structs - Implement Iterator for FFmpegDict * Fix and update schema * Data models and start populating MediaInfo in rust * Finish populating media info, chapters and program * Improve FFmpegFormatContext data raw pointer access - Implement stream data gathering * Impl FFmpegCodecContext, retrieve codec information - Improve some unsafe pointer uses - Impl from FFmpegFormatContext to MediaInfo conversion * Fix FFmpegDict Drop * Fix some crago warnings * Impl retrieval of video props - Fix C char* to Rust String convertion * Impl retrieval of audio and subtitle props - Fill props for MediaCodec * Remove simple_ffprobe now that the Rust impl is done * Fix schema to match actually retrieved media info - Fix import some FFmpeg constants instead of directly using values * Rework movie_decoder - Re-implement create_scale_string and add support anamorphic video - Improve C pointer access for FFmpegFormatContext and FFmpegCodecContext - Use newer FFmpeg abstractions in movie_decoder * Fix incorrect props when initializing MovieDecoder * Remove unecessary lifetimes * Added more native wrappers for some FFmpeg native objects used in movie_decoder * Remove FFmpegPacket - Some more improvements to movie_decoder * WIP * Some small fixes * More fixes Rename movie_decoder to frame_decoder Remove more references to film_strips * fmt * Fix duplicate migration for job error changes * fix rebase * Solving segfaults, fuck C lang Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com> * Update rust to version 1.77 - Pin rust version with rust-toolchain.toml - Change from dtolnay/rust-toolchain to IronCoreLabs/rust-toolchain for rust-toolchain support - Remove unused function and imports - Replace most CString uses with new c literal string * More segfault solving and other minor fixes Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com> * Fix ffmpeg rotation filter breaking portrait video thumbnails #2150 - Plus some other misc fixes * Auto format * Retrieve video/audio metadata on frontend * Auto format * First draft on ffmpeg data save on db Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com> * Fix some incorrect changes to prisma schema * Some fixes for the FFmpegData schema - Expand logic to save FFmpegData to db * A ton of things Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com> * Integrating ffmpeg media data in jobs and API * Rspc can't BigInt * 🙄 * Add initial ffmpeg metadata entries to Inspector - Fix ephemeral metadata api to match the files metadata api call * Fix Inspector not showing ffmpeg metadata * Add bitrate, start time and chapters video metadata to Inspector - Fix backend BigInt conversion incorrectly using i32 instead of u32 - Change FFmpegFormatContext/FFmpegMetaData bit_rate to i64 - Rename byteSize to humanizeSize - Expand humanizeSize logic to allow handling bits and Binary units - Move capitalize to @sd/client utils * Solving some issues * Fix ffmpeg probe getting incorrect stream id and breaking database unique constraint - Fix humanizeSize breaking when receiving floating numbers - Fix incorrect equality in StatCard - Fix unhandled error in Dialog when trying to remove an unknown dialog * fmt * small improvements - Remove some unecessary recursion_limit directive - Remove unused app_image releated functions - Fix metadata query enabled flag * Add migration for ffmpeg media data * Fix cypress test * Requested changes * Implement feedback - Update locale keys for all languages - Add pnpm command to update all language keys * Fix thumb reactivity in non indexed locations --------- Co-authored-by: Ericson Soares <ericson.ds999@gmail.com> Co-authored-by: Vítor Vasconcellos <HeavenVolkoff@users.noreply.github.com>
99 lines
3.4 KiB
YAML
99 lines
3.4 KiB
YAML
name: Setup Rust and Prisma
|
|
description: Setup Rust and Prisma
|
|
inputs:
|
|
target:
|
|
description: toolchain target triple
|
|
required: false
|
|
save-cache:
|
|
description: Whether to save the Rust cache
|
|
required: false
|
|
default: 'false'
|
|
restore-cache:
|
|
description: Whether to restore the Rust cache
|
|
required: false
|
|
default: 'true'
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Install Rust
|
|
id: toolchain
|
|
uses: IronCoreLabs/rust-toolchain@v1
|
|
with:
|
|
target: ${{ inputs.target }}
|
|
components: clippy, rustfmt
|
|
|
|
- name: Cache Rust Dependencies
|
|
if: ${{ inputs.restore-cache == 'true' }}
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ${{ inputs.target }}
|
|
save-if: ${{ inputs.save-cache }}
|
|
shared-key: stable-cache
|
|
|
|
- name: Cargo config.toml
|
|
shell: bash
|
|
run: echo '{}' | npx -y mustache - .cargo/config.toml.mustache .cargo/config.toml
|
|
|
|
- name: Turn Off Debuginfo and bump opt-level
|
|
shell: bash
|
|
if: ${{ runner.os != 'Windows' }}
|
|
run: |
|
|
sed '/\[profile.dev]/a\
|
|
debug = 0
|
|
' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml
|
|
|
|
sed '/\[profile.dev]/a\
|
|
opt-level=1
|
|
' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml
|
|
|
|
- name: Turn Off Debuginfo and bump opt-level
|
|
if: ${{ runner.os == 'Windows' }}
|
|
shell: powershell
|
|
run: |
|
|
(Get-Content Cargo.toml) -replace '\[profile.dev\]', '[profile.dev]
|
|
debug = 0' | Set-Content Cargo.toml
|
|
(Get-Content Cargo.toml) -replace '\[profile.dev\]', '[profile.dev]
|
|
opt-level=1' | Set-Content Cargo.toml
|
|
|
|
- name: Restore cached Prisma codegen
|
|
id: cache-prisma-restore
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
key: prisma-1-${{ runner.os }}-${{ hashFiles('./core/prisma/*', './crates/sync-generator/*', './Cargo.*') }}
|
|
path: crates/prisma/src/**/*.rs
|
|
|
|
- name: Generate Prisma client
|
|
working-directory: core
|
|
if: ${{ steps.cache-prisma-restore.outputs.cache-hit != 'true' }}
|
|
shell: bash
|
|
run: |
|
|
set -euxo pipefail
|
|
cargo prisma generate
|
|
|
|
# Check if a new migration should be created due to changes in the schema
|
|
cargo prisma migrate dev -n test --create-only --skip-generate
|
|
_new_migrations="$(
|
|
git ls-files --others --exclude-standard \
|
|
| { grep '^prisma/migrations/' || true; } \
|
|
| xargs sh -euxc '[ "$#" -lt 2 ] || grep -L "$@" || true' sh 'This is an empty migration' \
|
|
| wc -l \
|
|
| awk '{$1=$1};1'
|
|
)"
|
|
if [ "$_new_migrations" -gt 0 ]; then
|
|
echo "::error file=core/prisma/schema.prisma,title=Missing migration::New migration should be generated due to changes in prisma schema"
|
|
case "$GITHUB_REF" in
|
|
"refs/heads/main" | "refs/heads/gh-readonly-queue/main/"* | "refs/tags/"*)
|
|
# Fail action if we are on main or a release tag, to avoid releasing an app with a broken db
|
|
exit 1
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
- name: Save Prisma codegen
|
|
id: cache-prisma-save
|
|
if: ${{ steps.cache-prisma-restore.outputs.cache-hit != 'true' && (github.ref == 'refs/heads/main' || inputs.save-cache == 'true') }}
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
key: ${{ steps.cache-prisma-restore.outputs.cache-primary-key }}
|
|
path: crates/prisma/src/**/*.rs
|