Post Reply 
Album duration possible?
01-03-2022, 10:37 (This post was last modified: 01-03-2022 14:17 by simbun.)
Post: #7
RE: Album duration possible?
(01-03-2022 01:31)entdgc Wrote:  Followed your instructions and worked a treat....
Needs better formatting but getting late so that is for tomorrow...
That's good to hear.

I assume you mean the formatting in terms of the MinimServer .displayFormat? If you're talking about formatting the duration itself you're probably best to look at using printf e.g.
Code:
select pprintf('%02dh:%02dm:%02ds', sum(length_seconds)/3600, (sum(length_seconds)%3600)/60, sum(length_seconds)%60) as duration
  ffrom playlist
01h:47m:15s
NOTE: I had to use pprint and ffrom to get it to post.

If you have something specific in mind I can help you with that as it can get a bit messy.


(01-03-2022 01:31)entdgc Wrote:  The only 'fault' in your instructions was that foo_sqlite.fb2k-component was not on my system
RTFM ;-)
(27-02-2022 19:32)simbun Wrote:  Download the latest foobar and the sqlite plugin.


(01-03-2022 01:31)entdgc Wrote:  Was the code you have written in SQL language?
When you're in that console you're working within a SQLite (3.20.0) environment.
From the home page:
Quote:SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine. SQLite is the most used database engine in the world. SQLite is built into all mobile phones and most computers and comes bundled inside countless other applications that people use every day.

Most of what you'll be able to use in that environment is native SQLite, but the plugin also comes with MetaDB_Module(s) which allow you to interact with foobar playlists and files, and a bunch of other custom functions that aren't available to SQLite.

If you run
Code:
select * from playlist
you'll see just how much metadata you have available to you, things like:
  • Music Tags: All your music tags
  • Audio format: bitrate, bitspersample, channels, codec, encoding
  • File specifics: directoryname, filename, filesize, last_modified, length_seconds
  • playlist: playlist_name, playlist_item, item_is_selected, item_is_playing

A couple of examples of what I've used this tool for:
  • QA purposes: making sure each artist only has one corresponding artistsort value across the library
  • Reporting: Aggregating to one record per album to build a spreadsheet of my music collection
  • tagUpdate: For albums where only the last disc has a discsubtitle (typically a bonus disc), I use this to give the prior discs a discsubtitle (of album name) so I can play the non bonus disc separately. I know I could add it manually to the tags but if it's not on the official disc then it's not going in the tags :-)
as well as many others.

I'll subscribe to this thread so if you or anyone else has problems I'll (hopefully) be able to help, as I'm as passionate about foobar as I am about MinimServer.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Album duration possible? - entdgc - 26-02-2022, 17:02
RE: Album duration possible? - simbun - 27-02-2022, 11:45
RE: Album duration possible? - entdgc - 27-02-2022, 12:45
RE: Album duration possible? - simbun - 27-02-2022, 13:52
RE: Album duration possible? - simbun - 27-02-2022, 19:32
RE: Album duration possible? - simbun - 05-03-2022, 15:37
RE: Album duration possible? - simbun - 12-03-2022, 15:47
RE: Album duration possible? - entdgc - 01-03-2022, 01:31
RE: Album duration possible? - simbun - 01-03-2022 10:37
RE: Album duration possible? - entdgc - 01-03-2022, 14:42
RE: Album duration possible? - entdgc - 21-03-2022, 23:38
RE: Album duration possible? - simbun - 22-03-2022, 11:10
RE: Album duration possible? - entdgc - 23-03-2022, 20:33
RE: Album duration possible? - simbun - 23-03-2022, 21:44
RE: Album duration possible? - entdgc - 23-03-2022, 21:50
RE: Album duration possible? - KreTR - 07-08-2022, 16:24
RE: Album duration possible? - simbun - 07-08-2022, 17:19
RE: Album duration possible? - entdgc - 07-08-2022, 16:35
RE: Album duration possible? - KreTR - 08-08-2022, 21:22
RE: Album duration possible? - simbun - 08-08-2022, 23:33

Forum Jump:


User(s) browsing this thread: 1 Guest(s)