Search from lists - Powershell, etc?

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Search from lists - Powershell, etc?

Post by svillardi »

Hi! Is there a way for MediaMonkey to take a csv file of title, artist and do a full search to see if I have these songs before I go out and by another compilation with mostly the same stuff?

If so, could this be used to generate playlists or create new albums with the specific songs pulled from the query?

I'd love to manipulate the database with powershell.

Thanks!
IanRTaylorUK
Posts: 555
Joined: Fri Dec 27, 2019 4:41 pm

Re: Search from lists - Powershell, etc?

Post by IanRTaylorUK »

Hi Svillardi,

I am not certain of what you are trying to achieve. If you have the MP3 / Flac music files, then it would be best to add these to Media Monkey. Once in the MMW5 library then you can do a few things:

1). Entire Library / Artist / Album displays sorted by track number to spot missing tracks
2). Entire Library / All Tracks and select ALL to export a CSV using Reports / File List for querying in Microsoft Excel or Access
3). Using 2 and then cross-tabulating (for a single artist) track names vs albums to show "overlaps" e.g. where a "complete" or "ultimate" album is a "super-set" of individual albums.
4). Use the "built-in" Duplicates nodes i.e. Content / Titles / Titles & Artist
5). Write your own SQL using the SQL Editor add-on
6). Use the "Custom Nodes" for tracks / albums to highlight various "issues"
7). Use "Collections" to make your own compilation Play Lists based on things like Genre, Beats per Minute, Rating, Tempo and Quality.

However, for this to work well you might need to invest some time to make sure your tags are complete and consistent. For example adding Disc# and Track #s whilst making sure the album artist and artist are consistent.

If you want to manipulate the database (outside of Media Monkey) then make sure you schedule a daily backup using the Manage Database option AND perhaps only work on a copy! Several discussion in the forum on DB SQL Lite vs Access etc. ...

Hope this helps.
Ian Taylor
svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Re: Search from lists - Powershell, etc?

Post by svillardi »

Let me try to explain better.

I have all my music, over 250,000 songs in MediaMonkey. When I go to purchase a new CD, let's say at Amazon, I could copy the names of the songs/artists into a CSV file and use that data to see if I already have these songs without searching for them one-by-one.

I thought, perhaps with a PowerShell script.
Peke
Posts: 17781
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Search from lists - Powershell, etc?

Post by Peke »

Hi,
It is possible, but new addon needs to be made in order to import metadata from CSV/XML/JSON/...

I wonder isn't MM fetch Info Automatically for the inserted CD and you can easily Auto-Tag whole Album for rest of Metadata online?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Re: Search from lists - Powershell, etc?

Post by svillardi »

Peke,

The idea is to query my collection/database PRIOR to making a purchase.
IanRTaylorUK
Posts: 555
Joined: Fri Dec 27, 2019 4:41 pm

Re: Search from lists - Powershell, etc?

Post by IanRTaylorUK »

svillardi wrote: Thu Oct 12, 2023 1:11 pm Let me try to explain better.

I have all my music, over 250,000 songs in Media Monkey. When I go to purchase a new CD, let's say at Amazon, I could copy the names of the songs/artists into a CSV file and use that data to see if I already have these songs without searching for them one-by-one.

I thought, perhaps with a PowerShell script.
Hi Svillardi,
Interesting, at what point would you determine a purchase is warranted?

1). If Album Artist / Album / Title of online candidate is same as MMW Library = No purchase needed.
But what if:
a). Online quality is better e.g. 24bit FLAC vs 320 MP3?
b). Online album is a "Gold" or "Deluxe" or "Remaster" or "Special Edition" perhaps with additional tracks?
c). Newer album with alternative singer / featuring etc. For example, Steve Perry vs Arnel Pineda?

My recent activity has been moving from 320 MP3 to FLAC and I typically just run MMW5 in one screen and online resources in another. Created a few collections to assist e.g. Low Bit Rate, MP3s waiting for FLAC.

I also run both MMW5 and MMW4 (now on the same files / network location) so I can use some of the MMW4 add-ons yet to migrate to MMW5 e.g. Lyricator, Magic Nodes and Tagging Inconsistencies.
Ian Taylor
svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Re: Search from lists - Powershell, etc?

Post by svillardi »

Hi Ian,

I thought I had sent this previously, so I'll respond again-

While you make good points about deciding to buy a song based on multiple criteria, the first criteria, for me at least, is do I already have the song. Right now, I'm getting my feet wet on 40s and 50s jump blues, pre-rock and buying box sets and various artist series CDs. As I'm going down the rabbit hole there tend to be a lot of repeats. My goal is to get a list of songs on a CD (or box set) and do a complete search to see if I already own it, rather than going song by song. Does this software exist?
IanRTaylorUK
Posts: 555
Joined: Fri Dec 27, 2019 4:41 pm

Re: Search from lists - Powershell, etc?

Post by IanRTaylorUK »

Hi Svilardi,

I am not aware of any software to help query sites that sell music CDs in the manner you are suggesting. But someone else on the forum may do. Do you always require the physical CD?
Ian Taylor
svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Re: Search from lists - Powershell, etc?

Post by svillardi »

Hello Ian,

Unfortuately, I do not think you are understanding my request.

I have a collection of 250K songs in MediaMonkey. If I want to find a song, I go into the search field and type the title, artist or whatever criteria I am looking for. MM displays what I have. This is a completely MANUAL process.

Now, let's say I find a new 4 CD box set collection at Amazon I might be interested in purchasing. The box set may have 100 or more songs in it and those tracks might be listed in the description, like:

Big Hits of the 50's
Hound Dog - Elvis Presley
Sincerely - The Moonglows
Great Balls of Fire - Jerry Lee Lewis... etc.

I would like to be able to copy those into a CSV file and have MM automatically search to see if I already have them. I could then make a decision to buy the box set or not.

So the idea is to search my MM5 collection based on a file to see if I already own the song.
IanRTaylorUK
Posts: 555
Joined: Fri Dec 27, 2019 4:41 pm

Re: Search from lists - Powershell, etc?

Post by IanRTaylorUK »

https://octoberclub-my.sharepoint.com/: ... w?e=tdhqce

Code: Select all

SELECT 
tblPurchaseCandidates.Track, 
tblPurchaseCandidates.Artist, 
tblPurchaseCandidates.Reference, 
ArtistAlbumTracks.[Album Artist], 
ArtistAlbumTracks.Album, 
ArtistAlbumTracks.Title, 
ArtistAlbumTracks.Filename
FROM 
ArtistAlbumTracks 
RIGHT JOIN 
tblPurchaseCandidates 
ON ArtistAlbumTracks.Title = tblPurchaseCandidates.Track;
tblPurchaseCandidates is your CSV file with an added field for source reference.
ArtistAlbumTracks is an export from MMW5 and in this case refers to my library from say 1 month ago.
Ian Taylor
svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Re: Search from lists - Powershell, etc?

Post by svillardi »

OK, we're getting somewhere! To be clear, I'm not an SQL guy, which this appears to be.

Are there any APIs which would allow me to use powershell (and some examples... heh heh heh) to use an Import-CSV and query off that?

If not, can you show me how to actually do this? It would save a ton of searching time. Would I need some kind of SQLlite or something?
svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Re: Search from lists - Powershell, etc?

Post by svillardi »

And... just thought of this - I would rather not do it outside of MM. I'd rather do some kind of compare based on a list, within MM itself, as an additional advanced search.

And then turn it into a have it/want it checklist.

I know this is the wrong forum, but that would be a great feature.
IanRTaylorUK
Posts: 555
Joined: Fri Dec 27, 2019 4:41 pm

Re: Search from lists - Powershell, etc?

Post by IanRTaylorUK »

svillardi wrote: Mon Oct 16, 2023 10:18 am OK, we're getting somewhere! To be clear, I'm not an SQL guy, which this appears to be.
I used Microsoft Access two data tables and one query with a "link" between the two tables.
svillardi wrote: Mon Oct 16, 2023 10:18 am Are there any APIs which would allow me to use powershell (and some examples... heh heh heh) to use an Import-CSV and
query off that?
Not my area of expertise to be honest. Last time I used APIs was maybe a decade or two ago and called from VB / VBA.
svillardi wrote: Mon Oct 16, 2023 10:18 am If not, can you show me how to actually do this? It would save a ton of searching time. Would I need some kind of SQLlite or something?
Export CSV from MM5 and pull into MS Access as data table.
Create your second data table
Write simple query using Access tools then tweak query as needed.

If you are not familiar with Microsoft Access, then I would need to record a video. Well that is probably best / quickest way forward. Someone else might say use Excell another SQL Lite....
Ian Taylor
svillardi
Posts: 56
Joined: Wed May 10, 2017 7:55 pm

Re: Search from lists - Powershell, etc?

Post by svillardi »

Hi Ian,

I think i understand, however, how would you set up the second table?

Also, how would I suggest this as a feature request?

Thanks!
IanRTaylorUK
Posts: 555
Joined: Fri Dec 27, 2019 4:41 pm

Re: Search from lists - Powershell, etc?

Post by IanRTaylorUK »

Hi Svilardi,

Take a close look at this:

https://octoberclub-my.sharepoint.com/: ... Q?e=eQnm9x

It shows the two tables in the simple query and the correct "join".

I manually created tblPurchaseCandidates with 3 fields - all short text. You can then - for example - cut and paste from a spreadsheet to the table.

In my experience as a humble MMW5 user this "niche" request is unlikely to gain acceptance as a "core" feature. My guess is the MMW5 team would look for a "power" user to develop an add-on.

Best regards
Ian Taylor
Post Reply