Sha256: 10e906d6cf264adf07593a307bf6b62ef25f9647f3abc83eb2c3345faaea9c26

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

module Tagomatic

  module KnownFormats

    PREFIXES = [
            "%g/%a/%b-%y",
            "%g/%a/%b %Y",
            "%g/%a/%b %y",
            "%g/%a/%y-%b",
            "%g/%a/%Y %b",
            "%g/%a/%y %b",
            "%g/%a/%b",
            ]

    INFIXES = [
            "[disc%d]/",
            "[disk%d]/",
            "[cd%d]/",
            "(disc%d)/",
            "(disk%d)/",
            "(cd%d)/",
            "-disc%d/",
            "-disk%d/",
            "-cd%d/",
            " disc%d/",
            " disk%d/",
            " cd%d/",
            "/disc%d/",
            "/disk%d/",
            "/cd%d/",
            "/",
            ]

    SUFFIXES = [
            "%A-%B-%n-%t.mp3",
            "%B-%n-%t.mp3",
            "%A-%n-%t.mp3",
            "%n-%A-%t.mp3",
            "%n-%B-%t.mp3",
            "%n-%t.mp3",
            "%n.%t.mp3",
            "%n%t.mp3",
            "%t.mp3",
            ]

    def self.inflate_formats
      formats = []
      PREFIXES.each do |p|
        INFIXES.each do |i|
          SUFFIXES.each do |s|
            formats << (p + i + s)
          end
        end
      end
      formats
    end

    KNOWN_FORMATS = inflate_formats

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tagomatic-0.1.9 lib/tagomatic/known_formats.rb
tagomatic-0.1.8 lib/tagomatic/known_formats.rb