Module: MiniradioServer

Defined in:
lib/miniradio_server/app.rb,
lib/miniradio_server.rb,
lib/miniradio_server/version.rb

Overview

Rack application class

Defined Under Namespace

Classes: App, Error

Constant Summary collapse

MP3_SRC_DIR =

--- Configuration --- Directory containing the original MP3 files

File.expand_path('./mp3_files')
HLS_CACHE_DIR =

Directory to cache the HLS converted content

File.expand_path('./hls_cache')
SERVER_PORT =

Port the server will listen on

9292
FFMPEG_COMMAND =

Path to the ffmpeg command (usually just 'ffmpeg' if it's in the system PATH)

'ffmpeg'
HLS_SEGMENT_DURATION =

HLS segment duration in seconds

10
VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.ensure_directories_exist(dirs, logger) ⇒ Object

Ensures that the necessary directories exist, creating them if they don't.

Parameters:

  • dirs (Array<String>) —

    An array of directory paths to check and create.

  • logger (Logger) —

    Logger instance for outputting information.



30
31
32
33
34
35
36
37
# File 'lib/miniradio_server.rb', line 30

def self.ensure_directories_exist(dirs, logger)
  dirs.each do |dir|
    unless Dir.exist?(dir)
      logger.info("Creating directory: #{dir}")
      FileUtils.mkdir_p(dir)
    end
  end
end