View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009135 | MMW v4 | Framework: Scripts/Extensions | public | 2012-02-13 22:35 | 2012-02-15 07:48 |
Reporter | zvezdan | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | assigned | Resolution | open | ||
Summary | 0009135: All SDBMedia properties are read-only, even when wiki says that some could be set | ||||
Description | None Media property could be set, neither Label nor Serial Number. Here is the test code: Option Explicit Sub OnStartUp() Dim oMenuItem SDB.UI.AddMenuItemSep SDB.UI.Menu_Edit, -3, 0 Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0) oMenuItem.Caption = "Modify first track from E: in Library" oMenuItem.OnClickFunc = "Test1" oMenuItem.UseScript = Script.ScriptPath Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0) oMenuItem.Caption = "Add new virtual track to Library" oMenuItem.OnClickFunc = "Test2" oMenuItem.UseScript = Script.ScriptPath End Sub Sub Test1(oMenuItem) Dim sQuery Dim oSongIter Dim oSongData Dim oDbIter sQuery = "IDMedia = (SELECT IDMedia FROM Medias WHERE DriveLetter = 4)" Set oSongIter = SDB.Database.QuerySongs(sQuery) If Not oSongIter.EOF Then Set oSongData = oSongIter.Item oSongData.Media.MediaLabel = "Zvezdan" oSongData.Media.SerialNumber = &H12345678 oSongData.UpdateDB Set oSongIter = Nothing sQuery = "SELECT SerialNumber, Label FROM Medias WHERE DriveLetter = 4" Set oDbIter = SDB.Database.OpenSQL(sQuery) If Not oDbIter.EOF Then SDB.MessageBox "SerialNumber: " & oDbIter.ValueByIndex(0) & vbCr _ & "Label: " & oDbIter.ValueByIndex(1), _ mtInformation, Array(mbOK) End If Else SDB.MessageBox "There is no any track on E: drive.", _ mtInformation, Array(mbOK) End If End Sub Sub Test2(oMenuItem) Dim oSongData Dim sQuery Dim oDbIter Set oSongData = SDB.NewSongData oSongData.Path = "E:\" oSongData.Title = "MyLoc" oSongData.Media.MediaLabel = "Zvezdan" oSongData.Media.SerialNumber = &H12345678 oSongData.UpdateDB sQuery = "SELECT SerialNumber, Label FROM Medias WHERE DriveLetter = 4" Set oDbIter = SDB.Database.OpenSQL(sQuery) If Not oDbIter.EOF Then SDB.MessageBox "SerialNumber: " & oDbIter.ValueByIndex(0) & vbCr _ & "Label: " & oDbIter.ValueByIndex(1), _ mtInformation, Array(mbOK) End If sQuery = "DELETE FROM Songs WHERE SongTitle = 'MyLoc' AND SongPath = ':\'" SDB.DataBase.ExecSQL sQuery End Sub | ||||
Steps To Reproduce | With the first option you need to have E: drive, or change DriveLetter in code appropriately. The second option adds virtual track to the Library and adds E: drive to the Medias table, but not with the specified MediaLabel and SerialNumber but with the already assigned values to the drive. | ||||
Tags | No tags attached. | ||||
Fixed in build | |||||