Skip to content

Commit 4ab3cbd

Browse files
committed
feat(legacy): now macro should use show start time when available (#3175)
### Description Previously the `now` macro used the current time. This is a bit confusing for autoloading playlists with dynamic smart blocks, as you have to think about when autoloading happens. This just makes the autoload datetime be the show start datetime. **This is a new feature**: Yes **I have updated the documentation to reflect these changes**: Yes ### Testing Notes **What I did:** I started up libretime, created an autoloading playlist with a dynamic block set for one hour ahead. I then created a show with the autoloading playlist one hour ahead of now and saw that it autoloaded properly and that the hour matched the show start hour and not the current hour. I also verified that the now functionality was not changed when not autoloading by using the preview tracks button on the dynamic smart block. **How you can replicate my testing:** See `What I did` section. ### **Links** _Issues links or other related resources. Use the line Closes: #bug_number to link a bug in the issue tracker._ libretime/libretime@5d7df2f
1 parent 79c8721 commit 4ab3cbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/user-manual/playlists.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Smart blocks are automatically filled with media files from the LibreTime librar
3737
To create a smart block, click the **Smartblocks** button on the left sidebar, and select **New** from the toolbar. Like a playlist, smart blocks can have a title and description, which you can edit. This helps you find relevant smart blocks in searches.
3838

3939
Fill out the smart block's **Name**, **Search Criteria**, and **Limit to** sections. The search criteria can be any one of LibreTime's metadata categories, such as **Title**, **Creator** or **Genre**. The modifier depends on whether the metadata in question contains letters or numbers. For example, **Title** has modifiers including _contains_ and _starts with_, whereas the modifiers for **BPM** include _is greater than_ and _is in the range_.
40-
To filter tracks using today's date information, use the `now{}` macro. Format characters are listed in the [php documentation](https://www.php.net/manual/en/datetime.format.php). For example, to filter to tracks with a **Title** that ends in `Instrumental Jan 2024` where `Jan 2024` is the current month and year, add a criteria for **Title** with a modifier of **ends with** and a value of `Instrumental now{M Y}`. The macro uses the configured station timezone to resolve dates and times.
40+
To filter tracks using today's date information, use the `now{}` macro. Format characters are listed in the [php documentation](https://www.php.net/manual/en/datetime.format.php). For example, to filter to tracks with a **Title** that ends in `Instrumental Jan 2024` where `Jan 2024` is the current month and year, add a criteria for **Title** with a modifier of **ends with** and a value of `Instrumental now{M Y}`. The macro uses the configured station timezone to resolve dates and times. For dynamic autoloading smart blocks the datetime used is the start datetime of the show. In all other cases the current datetime is used.
4141

4242
If you have a large number of files which meet the criteria that you specify, you may wish to limit the duration of the smart block using the **Limit to** field, so that it fits within the show you have in mind. Select **hours**, **minutes** or **items** from the drop-down menu, and click the **Generate** button again, if it's a static smart block. Then click the **Save** button.
4343

0 commit comments

Comments
 (0)