Files
danbooru/app/logical
evazion cb35bad237 media assets: fix incorrect frame counts for certain .webm files.
Fix calculating incorrect frame counts for certain .webm files. An
example is https://danbooru.donmai.us/media_assets/5968481.

Caused by ffmpeg printing multiple `frame= NNN` lines, and us taking the
first one instead of the last one:

    frame=    1 fps=0.0 q=-0.0 size=N/A time=00:00:00.08 bitrate=N/A speed=2.07x    
[null @ 0x56046ff4e440] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 321 >= 321
    [null @ 0x56046ff4e440] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 321 >= 321
    frame=  395 fps=0.0 q=-0.0 size=N/A time=00:00:06.66 bitrate=N/A speed=12.3x    
frame=  791 fps=759 q=-0.0 size=N/A time=00:00:13.26 bitrate=N/A speed=12.7x    
frame= 1193 fps=772 q=-0.0 size=N/A time=00:00:19.94 bitrate=N/A speed=12.9x    
frame= 1374 fps=780 q=-0.0 Lsize=N/A time=00:00:22.86 bitrate=N/A speed=  13x
    video:719kB audio:4288kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2022-11-03 22:01:51 -05:00
..
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2022-01-15 23:20:49 -06:00
2022-10-18 18:14:01 -05:00
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2022-10-18 18:14:01 -05:00
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2021-12-14 21:33:27 -06:00
2022-09-11 17:47:44 -05:00
2021-12-14 21:33:27 -06:00

Logical

This directory contains library code used through Danbooru. This includes things like defining API clients, dealing with sources, parsing tag searches, storing and resizing images, and so on.

Many of the files here use the Service Object pattern. Instead of putting complex code in models or controllers, it goes here, in plain old Ruby objects (POROs). This keeps models and controllers simpler, and keeps domain logic isolated and independent from the database and the HTTP request cycle.

External links