Skip to content

Commit

Permalink
Added db and dtos
Browse files Browse the repository at this point in the history
  • Loading branch information
jsixface committed Jan 13, 2025
1 parent 19fec19 commit 60b4d1d
Show file tree
Hide file tree
Showing 15 changed files with 658 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ij_continuation_indent_size = 4
# ij_wrap_on_typing = false
ij_java_use_single_class_imports = true

[*.yml]
[{*.yml,*.yaml}]
indent_size = 2

[{*.kt,*.kts}]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ captures
!*.xcworkspace/contents.xcworkspacedata
**/xcshareddata/WorkspaceSettings.xcsettings
/server/static/
/.kotlin
/.kotlin
*.db
17 changes: 17 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
[versions]
compose-plugin = "1.7.3"
exposed-version = "0.56.0"
koin = "4.1.0-Beta1"
kotlin = "2.1.0"
kotlinx-coroutines = "1.10.1"
kotlinx-datetime = "0.6.1"
kotlinx-serialization = "1.7.3"
ksp = "2.1.0-1.0.29"
ktor = "3.0.3"
liquibase = "4.30.0"
logback = "1.5.15"
logstash-logback-encoder = "8.0"
material3-adaptive = "1.0.1"
napier = "2.7.1"
sqlite = "3.47.1.0"

[libraries]
exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed-version" }
exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed-version" }
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed-version" }
exposed-json = { module = "org.jetbrains.exposed:exposed-json", version.ref = "exposed-version" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-ktor = { module = "io.insert-koin:koin-ktor3", version.ref = "koin" }
Expand Down Expand Up @@ -45,8 +52,18 @@ material3-adaptive = { module = "org.jetbrains.compose.material3.adaptive:adapti
material3-adaptive-layout = { module = "org.jetbrains.compose.material3.adaptive:adaptive-layout", version.ref = "material3-adaptive" }
material3-adaptive-navigation = { module = "org.jetbrains.compose.material3.adaptive:adaptive-navigation", version.ref = "material3-adaptive" }
napier = { module = "io.github.aakira:napier", version.ref = "napier" }
liquibase-core = { module = "org.liquibase:liquibase-core", version.ref = "liquibase" }
sqlite = { module = "org.xerial:sqlite-jdbc", version.ref = "sqlite" }

[bundles]
database = [
"exposed-core",
"exposed-dao",
"exposed-jdbc",
"exposed-json",
"liquibase-core",
"sqlite"
]
koin-server = [
"koin-core",
"koin-ktor",
Expand Down
1 change: 1 addition & 0 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies {
implementation(libs.logback)
implementation(libs.logstash.logback.encoder)
implementation(libs.bundles.ktor.server)
implementation(libs.bundles.database)
implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.json)
implementation(libs.bundles.koin.server)
Expand Down
312 changes: 312 additions & 0 deletions server/sample-output.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,312 @@
// ffprobe -v error -of json -show_entries stream:program:format:chapter FILE_NAME | jq
[
{
"programs": [],
"stream_groups": [],
"streams": [
{
"index": 0,
"codec_name": "hevc",
"codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
"profile": "Main",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1920,
"height": 802,
"coded_width": 1920,
"coded_height": 808,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "960:401",
"pix_fmt": "yuv420p",
"level": 120,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "24000/1001",
"avg_frame_rate": "24000/1001",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"extradata_size": 1957,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"BPS-eng": "10036302",
"DURATION-eng": "01:31:43.427000000",
"NUMBER_OF_FRAMES-eng": "131926",
"NUMBER_OF_BYTES-eng": "6904257195",
"_STATISTICS_WRITING_APP-eng": "mkvmerge v47.0.0 ('Black Flag') 64-bit",
"_STATISTICS_WRITING_DATE_UTC-eng": "2020-07-10 22:03:01",
"_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
"ENCODER": "Lavc57.89.100 libx265",
"DURATION": "01:31:43.436000000"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 6,
"channel_layout": "5.1",
"bits_per_sample": 0,
"initial_padding": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "eng",
"title": "English",
"BPS-eng": "767858",
"DURATION-eng": "01:31:43.445000000",
"NUMBER_OF_FRAMES-eng": "171951",
"NUMBER_OF_BYTES-eng": "528233472",
"_STATISTICS_WRITING_APP-eng": "mkvmerge v47.0.0 ('Black Flag') 64-bit",
"_STATISTICS_WRITING_DATE_UTC-eng": "2020-07-10 22:03:01",
"_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
"ENCODER": "Lavc57.89.100 aac",
"DURATION": "01:31:43.466000000"
}
},
{
"index": 2,
"codec_name": "ass",
"codec_long_name": "ASS (Advanced SSA) subtitle",
"codec_type": "subtitle",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 5503466,
"duration": "5503.466000",
"extradata_size": 547,
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "eng",
"title": "English",
"BPS-eng": "66",
"DURATION-eng": "01:20:03.315000000",
"NUMBER_OF_FRAMES-eng": "1033",
"NUMBER_OF_BYTES-eng": "39733",
"_STATISTICS_WRITING_APP-eng": "mkvmerge v47.0.0 ('Black Flag') 64-bit",
"_STATISTICS_WRITING_DATE_UTC-eng": "2020-07-10 22:03:01",
"_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
"ENCODER": "Lavc57.89.100 ssa",
"DURATION": "01:20:41.374000000"
}
}
],
"chapters": [],
"format": {
"filename": "Friends WEB HEVC x265.mkv",
"nb_streams": 3,
"nb_programs": 0,
"nb_stream_groups": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "0.000000",
"duration": "5503.466000",
"size": "1009779777",
"bit_rate": "1467845",
"probe_score": 100,
"tags": {
"ENCODER": "Lavf57.71.100"
}
}
},
{
"programs": [],
"stream_groups": [],
"streams": [
{
"index": 0,
"codec_name": "mpeg4",
"codec_long_name": "MPEG-4 part 2",
"profile": "Simple Profile",
"codec_type": "video",
"codec_tag_string": "XVID",
"codec_tag": "0x44495658",
"width": 512,
"height": 384,
"coded_width": 512,
"coded_height": 384,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "4:3",
"pix_fmt": "yuv420p",
"level": 3,
"chroma_location": "left",
"refs": 1,
"quarter_sample": "false",
"divx_packed": "false",
"r_frame_rate": "2997/125",
"avg_frame_rate": "2997/125",
"time_base": "125/2997",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 32865,
"duration": "1370.745746",
"bit_rate": "931263",
"nb_frames": "32865",
"extradata_size": 68,
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0,
"multilayer": 0
}
},
{
"index": 1,
"codec_name": "mp3",
"codec_long_name": "MP3 (MPEG audio layer 3)",
"codec_type": "audio",
"codec_tag_string": "U[0][0][0]",
"codec_tag": "0x0055",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "3/125",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 57114,
"duration": "1370.736000",
"bit_rate": "130584",
"nb_frames": "57114",
"extradata_size": 12,
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0,
"multilayer": 0
}
}
],
"format": {
"filename": "Friends-DVD.avi",
"nb_streams": 2,
"nb_programs": 0,
"nb_stream_groups": 0,
"format_name": "avi",
"format_long_name": "AVI (Audio Video Interleaved)",
"start_time": "0.000000",
"duration": "1370.745746",
"size": "184123392",
"bit_rate": "1074588",
"probe_score": 100,
"tags": {
"software": "VirtualDubMod 1.5.10.1 (build 2439/release)"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.jsixface.codexvert

import io.github.jsixface.codexvert.db.migrateDatabases
import io.github.jsixface.codexvert.plugins.configureHTTP
import io.github.jsixface.codexvert.plugins.configureKoin
import io.github.jsixface.codexvert.plugins.configureRouting
Expand All @@ -12,6 +13,7 @@ fun main(args: Array<String>): Unit = EngineMain.main(args)

fun Application.module() {
configureKoin()
migrateDatabases()
configureRouting()
configureHTTP()
}
Expand Down
Loading

0 comments on commit 60b4d1d

Please sign in to comment.