i have a large music library, and when i have to do a "rescan all", re-install, or upgrade, it seems to drop my playlist history from the dynamic playlists. i really like the dynamic playlists. so i wrote a script to pull in songs from my static m3u playlist and "seed" the dynamic list with a couple hundred of my favorite songs. i know this isn't something you support, but would be easy to add as a cool feature to asset.
what do you think? anyone else interested?
Code:
---script written in powershell and requires a .net sqlite3 provider. -------
---------i used this one: http://sqlite.phxsoftware.com/------------
Clear-Host
try{
[System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\SQLite.NET\bin\x64\System.Data.SQLite.dll") | Out-Null
}
catch{
[System.Reflection.Assembly]::LoadFrom("C:\Program Files\SQLite.NET\bin\System.Data.SQLite.dll") | Out-Null
}
$m3ufile = Get-Content "c:\temp\biglist.m3u"
$cn = New-Object -TypeName System.Data.SQLite.SQLiteConnection
$cn.ConnectionString = "Data Source=C:\temp\uMediaLibraryMainDBv2.bin"
foreach ($row in $m3ufile){
if($row.Length -gt 10 -and $row.StartsWith('*blooper*EXTINF')){
$cn.Open()
$cm = New-Object -TypeName System.Data.SQLite.SQLiteCommand
$sql = 'update uMediaTable SET PlayCount ="10" where filename like "%'+ $row.Remove(0,10) + '"'
$sql
$cm = New-Object -TypeName System.Data.SQLite.SQLiteCommand($sql,$cn)
$dr = $cm.ExecuteNonQuery()
$cn.Close()
}
}