Add support for smart playlist manipulation by date added to database. Updated mt-daapd.playlist to match

This commit is contained in:
Ron Pedde
2004-09-12 23:20:29 +00:00
parent 5463b63436
commit e43caee157
10 changed files with 215 additions and 18 deletions

View File

@@ -20,13 +20,16 @@
# Orchestra (string)
# Conductor (string)
# Grouping (string) -- I don't even know what this is...
# Comment (string)
# Year (int)
# BPM (int)
# Bitrate (int)
# Date (date)
#
# Valid operators include:
# is, includes (string)
# >, <, <=, >=, = (int)
# after, before (date)
#
# the "is" operator must exactly match the tag,
# while the "includes" operator matches a substring.
@@ -69,6 +72,52 @@
# orchestra or conductor... this would probably include any
# orchestral music. Kind of ugly, but works!
#
#
# DATES
#
# Dates are kind of funky. The "date" of a file is when it
# was created on the file system, or the date that it was first
# entered into the database, whichever is earlier. The date of
# a file can be matched with the terms "before" or "after".
#
# One example of a valid date is a date in yyyy-mm-dd format:
#
# "Files added after January 1, 2004" {
# date after 2004-01-01
# }
#
# There are also some special date keywords:
# "today", "yesterday", "last week", "last month", "last year"
#
# A valid date can also be made by appling an interval to a
# date. As an example, a valid date might be:
#
# 3 weeks before today
# or
# 3 weeks ago
#
# You can combine these, of course.
#
# "3 weeks before today" is the same as "2 weeks before last week"
# or "1 week after last month" or "21 days before today" or
# "20 days before yesterday" or "7 days after last month". You get
# the idea.
#
# Note that the playlists are only generated at the time that mt-daapd
# starts... so while the dates will be accurate at start time, they
# may become inaccurate with time. Yes, I know... it's on my list. :)
#
# So, examples:
#
# "Recently Added MP3s" {
# date after last month AND file includes ".mp3"
# }
#
# This matches only mp3 files added in the last 30 days.
#
#
# SUMMARY
#
# I expect that this language will grow over time. If you want
# to hack on it, see src/lexer.l, src/parser.y, and src/playlist.c
#
@@ -77,22 +126,19 @@
#
"60's Music" {
Year > 1959 && Year < 1970
Year >= 1960 && Year < 1970
}
"70's Music" {
Year > 1969 && Year < 1980
"Recently Added" {
Date after 2 weeks ago
}
"80's Music" {
Year > 1979 && Year < 1990
"Non-DRMed Music" {
path not includes ".m4p"
}
"90's Music" {
Year > 1989 && Year < 2000
"AAC Files" {
path includes ".m4p" ||
path includes ".m4a" ||
path includes ".aac"
}
"00's Music" {
Year > 1999
}