Beta 5: Wrong file size reported for Virtual CDs

Post a reply

In an effort to prevent automatic submissions, we require that you complete the following challenge.
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review

Expand view Topic review: Beta 5: Wrong file size reported for Virtual CDs

by jiri » Fri May 21, 2004 3:51 am

The only missing thing is that MM stores the original filesize to 'OrigFileLength' field in Songs table, it helps to restore the filesize when track is removed from VCD. However, this field isn't accessible directly from scripting, it can be modified only by executing appropriate SQL (and it can be done through scripting).


by mikeryan » Sun May 16, 2004 7:01 pm

jiri wrote: There currently isn't any way how to update filesize for tracks already in VCD, the only option for now is to copy tracks to VCD again. I hope someone will write a script in case it's needed... :wink:
Something like this, perhaps?

Code: Select all

'Fixes VCD file sizes

Option Explicit 

Sub FixFileSizes
  ' Define variables 
  Dim list, itm, i, result, fso

  ' Get list of selected tracks from MediaMonkey 
  Set list = SDB.SelectedSongList 
  If list.count=0 Then 
    Set list = SDB.AllVisibleSongList 
  End If  
  Set fso = CreateObject("Scripting.FileSystemObject")
  ' Use progress to notify user about the current action
  Dim Progress
  Set Progress = SDB.Progress
  Progress.Text = SDB.Localize("Fixing VCD file sizes...")
  Progress.MaxValue = list.count
  ' Process all selected tracks 
  For i=0 To list.count-1 
    Set itm = list.Item(i) 
    If (itm.Cached) Then
      Dim fileObj
      ' Connect to the FileSystemObject
      Set fileObj = fso.GetFile(itm.CachedPath)
      'result = SDB.MessageBox(itm.CachedPath & ",len="&itm.FileLength&",realLen="&fileObj.Size, mtInformation, Array(mbOk))
      itm.FileLength = fileObj.Size
      set fileObj = nothing
    End If
    if Progress.Terminate then
      Exit For
    end if

  ' hide progress
  Set Progress = Nothing

End Sub 
My VB is a bit rusty, but it seemed to do the job on the few tracks I tried. Anything obviously missing there?


by jiri » Sun May 16, 2004 12:45 pm

Re. the glitch - I don't see any reason for this, if track is correctly copied to the VCD from audio CD, filesize should be properly updated. If you find anything else about it, let me know please.

There currently isn't any way how to update filesize for tracks already in VCD, the only option for now is to copy tracks to VCD again. I hope someone will write a script in case it's needed... :wink:


by mikeryan » Sat May 15, 2004 11:50 am

Thanks for including this fix in RC2. I had a little glitch - the first CD I tried copying to VCD was Bob Seger's Night Moves - 8 of the 9 tracks show the correct (HD) filesize, but track #8 shows the CD filesize. I tried removing just that track and copying it again, same thing. I don't see anything unusuable about the track - it's one of the shorter ones (but not the shortest) on the album, I didn't get any complaints from MM about trouble reading the disk... Anyway, deleting the album entirely from the library and redoing the copy seemed to work, and the next couple of disks had no problem at all.

On another note - how can I correct all the existing VCD filesizes in my database?


by mikeryan » Thu May 13, 2004 5:06 pm

The inconsistency wouldn't bother me any - if you think of the filesize field as "the number of bytes that will be transferred (or whatever) if I use the file", it's not really inconsistent at all. I wouldn't be bothered by stale filesize data when removing tracks from the VCD either, I really have no interest in what the size on the external disk is. Of course, you could clear that field (or update it if the original disk happens to be mounted), but I don't think it's a big enough deal to squeeze in for 2.2. Assuming VCD data is kept in its own DB table (I have Access 97, it won't open the MM DB for me to poke around myself), I'd think the ideal solution would be to save the VCD filesize there and keep the original disk size in the main table, but of course you don't want to make metadata changes at this stage of development.

As long as size-limited autoplaylists work right, I'll be happy... I've been managing my player contents and playlists by hand on fairly complicated criteria, and MM 2.2 will be very close to letting me fully automate it. I've been looking for a media database app for a while (even sketched out a design for building it myself, including the VCD concept), I really appreciate you doing the work for me - thanks!

Virtual CD and filesize

by rusty » Thu May 13, 2004 11:16 am

We're a bit constrained by the current virtual CD implementation, so I need some feedback here:

It's possible to store cached filesize to original filesize field in the Library during caching. However, there are a couple of problems:
-This would introduce a bit of inconsistency into the Virtual CD in the sense that tracks in a CD that aren't on the VCD, show the file size on the CD, whereas those that are stored to the VCD show the size of the compressed file on the Hard drive.
- The size value would stay there forever, even after the file is removed from VCD!

I think that this is a reasonable tradeoff, but I'd like to hear some opinions.

Note: we'd also provide some one-time functionality to update all VCD entries to show filesize on the HD rather than on the CD.

<edit>: we'd also _like_ to provide some one-time functionality.... but hope that someone will come up with a script for this so we can focus on other features.


by mikeryan » Wed May 12, 2004 5:32 pm

Any plans to fix this?

by Guest » Fri May 07, 2004 10:03 pm

This problem remains in the release candidate - with virtual CDs, MM reports the size on the original disk, not the size of the ripped file. Thus, for example, trying to create an AutoPlaylist to fill up 5GB of a jukebox won't work properly, it will select far short of the necessary files.

Beta 5: Wrong file size reported for Virtual CDs

by mikeryan » Sat Apr 17, 2004 11:02 am

For tracks on (audio) Virtual CDs, Media Monkey reports the size on the CD, not the size of the ripped track on the disk. This applies both to the File Size column and to the total in the status bar.

I was setting up a playlist for my first attempt to sychronize with my 20GB jukebox and was trying to use the status bar totals to gauge when I had enough on the playlist to fill the player, I'm not sure now if there's a way to do that...