owncloud / music

:notes: Music app for ownCloud
GNU Affero General Public License v3.0
563 stars 197 forks source link

Overview of different file types #1136

Closed djtulan closed 4 months ago

djtulan commented 6 months ago

I have a questions. Would it be difficult to show some kind of files statistics of file types of files scanned?

I found out, that the REST API apps/music/api/scanstate shows the number of scanned files Would it be possible to add a count of different files types. (e.g. mp3, flac, wav, aiff, ...) "mp3_count": 123, "flac_count": 123 and so on, depending on the file types found?

I made myself a script to count all music files stored in my library. It gives me the following output:

Total Music Files: 43170 Flac Files: 42629 MP3 Files: 308 AIFF Files: 217 WAV Files: 16

The music app REST API show me that information: {"unscannedFiles":[],"scannedCount":42967}

So some of the files my script found are not listet in the music app. I would be very helpful to find you what file types are not scanned.

Also it would be nice to show the content of the scanned files somewhere in the app. Maybe a good place would be in settings, where also the "Reset Collection" command is located.

paulijar commented 6 months ago

IMHO, feature like this wouldn't be useful so often and for so many users that it would justify spending the development time and effort needed. Every new feature has the opportunity cost, as there are plenty of alternative features where the same time could be used instead, and the time is a scarce resource.

However, I'm currently working on adding an "Advanced search" view which could be used to dig out also this data by running a few queries on the scanned songs: it will be possible to search e.g. with a rule like "search all songs with filename ending with '.flac'", among the countless other alternatives.

As of today in Music v1.10.0, the similar advanced search feature is already available in the Ampache API. To my knowledge, Ample is the only client which enables you to use this part of the API.

Your other alternative would be to query this directly from the database. Something like this should work:

select mimetype, count(id) from oc_music_tracks where user_id='your_username' group by mimetype;
djtulan commented 5 months ago

Do you have any experience to run Ample on a separate server? I always get CORS errors, because the ample js trys to load code from my nextcloud server. Any solution how to allow my webserver to access my nextclound music app?

paulijar commented 5 months ago

No, I haven't tried that. I believe I have read from the Ample page that its developer has intended the Ample sw to be installed on the same server with the Ampache back-end. And if someone wants to use it some other way, then it will be up to the user to solve any CORS issues caused by this. But what would this require, I don't know.

paulijar commented 4 months ago

Music v1.11.0 now has the Advanced search view which, among other things, allows finding tracks based on the file extension. As that more or less fills the original need described in the OP, I'm closing this issue.

djtulan commented 4 months ago

The Advanced search view works fine for my needs!