Disk quota management fixed (2 Viewers)

Midget

Portal Pro
October 1, 2007
78
2
Siena
Home Country
Italy Italy
Hello,

The disk quota management for TVE3 didn't work.
The class involved is DiskManagement.

I've fixed some issues:

1- The timer was disabled
2- There were some problems with exceptions (ie. parsing the settings with empty text)
3- There were no code to actually delete the files, the recordings were only removed from DB

I've also improved logging.

I've submitted the patch on SourceForge

Bye
:)
 

nissse

Portal Member
September 27, 2006
15
0
45
Home Country
Sweden Sweden
Thx alot =)

"The file is compiled against last SVN 17675." Those this mean it is fixed in the newest SVN ? Or do I need to download the DiskManagement.cs file.

If I do where does it go ?

Sorry Im new to this
 

Midget

Portal Pro
October 1, 2007
78
2
Siena
Home Country
Italy Italy
Thx alot =)

"The file is compiled against last SVN 17675." Those this mean it is fixed in the newest SVN ? Or do I need to download the DiskManagement.cs file.

If I do where does it go ?

Sorry Im new to this

There are some guidelines to contribute to the project, and in particular there is a patch policy.

The source code is hosted on a SVN repository that you can browse online or download on your PC.

When you develop a patch you have to submit it on SourceForge tracker. A project developer will examine it and, if approved, the patch will be integrated into the main SVN code.

At the moment my patch is assigned to a developer and in "pending" status, so it isn't yet integrated into the official SVN code. The sentence "The file is compiled against last SVN 17675" means that I've developed, compiled and tested the patch with that SVN version. If newest version don't modify anything related, the patch will be just fine. From time to time, until the patch will be integrated, I will check compatibility with newest SVN versions.

If you can't wait and want to give it a try, you could download the TVE3 source code, apply the patch on your source code copy and then compile a new version of TVService.exe
In fact on my media center PC is currently running a patched TVService with DiskManagement enabled.

Bye
 

Maschine

Retired Team Member
  • Premium Supporter
  • June 15, 2004
    768
    86
    Germany
    Home Country
    Germany Germany
    Hey Midget,

    I looked at your patch today. I'm sorry, but I won't integrate it to our SVN. The patch itself is fine, all your changes look good, but more changes need to be done, especially within the configuration app.

    1) Deleting recordings is a very critical topic. Many users don't want MP to delete anything. They'll prefer loosing the new recording (which can't start because of no disk space) over getting their old files deleted. So we need a general option to turn diskmanagement completely off.

    2) The check for free disk space is currently done for all drives on the computer. Imagine a scenario with 1 system disk and 1 disk for recordings. The system disk has just 200 MB free space while the recordings disk still has 50+GB free space. Diskmanagement will start to delete one recording after another because the system disk won't get any more space. ==> Diskmanagement should only monitor those drives that actually contain recordings (i.e. the recordings folder is on those disks).

    If you add those 2 points, I can add your patch to the official builds. In its current state I need to reject it, sorry.

    I hope you understand my descission and "fix" the 2 mentioned issues, because -as I said above- your code itself is fine.

    Maschine
     

    Midget

    Portal Pro
    October 1, 2007
    78
    2
    Siena
    Home Country
    Italy Italy
    I looked at your patch today. I'm sorry, but I won't integrate it to our SVN. The patch itself is fine, all your changes look good, but more changes need to be done, especially within the configuration app.
    Maybe I'm missing something: the DiskManagement was already there, it was simply disabled and not fully developed. There were a plan with it ?
    I've tried to contact Frodo (the developer that posted it for the first time) with a PM but didn't get reply yet.

    I've fixed the DiskManagement class because I really need that feature (my 500GB hd was filled with recordings!:p )

    Maybe we could fully plan the disk management feature here ? :)

    1) Deleting recordings is a very critical topic. Many users don't want MP to delete anything. They'll prefer loosing the new recording (which can't start because of no disk space) over getting their old files deleted. So we need a general option to turn diskmanagement completely off.
    Sure, I completely agree with you.
    How we could implement this ?
    1- adding a boolean to the settings (with a checkbox in SetupTV and verifing that setting in DiskManagement)
    2- setting the default disk quota to zero (at the moment in DiskManagement if the quota is less than 50MB or unreadable it is set to 50MB and the delete process will continue)

    The second option is less invasive so I would prefer it.

    2) The check for free disk space is currently done for all drives on the computer. Imagine a scenario with 1 system disk and 1 disk for recordings. The system disk has just 200 MB free space while the recordings disk still has 50+GB free space. Diskmanagement will start to delete one recording after another because the system disk won't get any more space. ==> Diskmanagement should only monitor those drives that actually contain recordings (i.e. the recordings folder is on those disks).
    No, this scenario can't happen. DiskManagement work this way:

    1- it get a list of drives in the system
    2- for each drive in the list start the procedure:
    2.1- check disk space on drive
    2.2- get quota setting for drive (if less than 50MB or unreadable it set to 50MB)
    2.3- get recordings on drive
    2.4- sort recordings by date
    2.5- delete recordings until disk quota is reached (NOTE: it delete only recordings with the "Keep until space is needed" property)

    If you add those 2 points, I can add your patch to the official builds. In its current state I need to reject it, sorry.

    I hope you understand my descission and "fix" the 2 mentioned issues, because -as I said above- your code itself is fine.
    No problem. Let take a decision together.

    Bye :)
     

    Maschine

    Retired Team Member
  • Premium Supporter
  • June 15, 2004
    768
    86
    Germany
    Home Country
    Germany Germany
    Maybe I'm missing something: the DiskManagement was already there, it was simply disabled and not fully developed. There were a plan with it?
    Indeed, it is not fully developed, that's most likely the reason that it was disabled. So just enabling wouldn't be a solution and we need to change some things first ;)

    Maybe we could fully plan the disk management feature here ? :)
    Sure, let's do it :cool:

    How we could implement this ?
    1- adding a boolean to the settings (with a checkbox in SetupTV and verifing that setting in DiskManagement)
    2- setting the default disk quota to zero (at the moment in DiskManagement if the quota is less than 50MB or unreadable it is set to 50MB and the delete process will continue)
    I think the easiest way from a user's view would be the following. Diskmanagement is disabled by default. The settings page in the configuration tab is completely greyed out until the user checks a checkbox "Use disk management" (the boolean you proposed). Then the options for quota settings are available and can be changed on that page.

    No, this scenario can't happen. DiskManagement work this way:
    Sorry, my fault. I simply missed the part where it checks the recording file part :oops: . So we are already fine here :). Nevertheless (again an improvement for the configuration part) the user should not be able to set a quota for a drive where no recordings are stored as that doesn't make sense and just leads to confusion. That's more a "nice to have" feature and should not prevent the patch from beeing added.

    Looking forward to your answer and your new files.

    Maschine
     

    Midget

    Portal Pro
    October 1, 2007
    78
    2
    Siena
    Home Country
    Italy Italy
    I think the easiest way from a user's view would be the following. Diskmanagement is disabled by default. The settings page in the configuration tab is completely greyed out until the user checks a checkbox "Use disk management" (the boolean you proposed). Then the options for quota settings are available and can be changed on that page.
    Ok. I'll take this task ;)

    Nevertheless (again an improvement for the configuration part) the user should not be able to set a quota for a drive where no recordings are stored as that doesn't make sense and just leads to confusion. That's more a "nice to have" feature and should not prevent the patch from beeing added.
    Mmmm... here I've digged into the code. The disk quota settings are saved on a "per system disk" basis (ie. "freediskspacec", "freediskspaced", etc.) on the [Setting] table. The recording folder is saved on a "per tv card" basis on the [Card] table.
    I could look at the [Card] table and retrieve the card-disk coupling... there is a better way ?

    What about the "KeepUntil" property of Recording class ?
    In DiskManagement at the moment are deleted only recordings with "UntilSpaceNeeded" value. I think that it is the default value or a least on my db every recording has the 0 (=UntilSpaceNeeded) value.
    Other allowed values are: UntilWatched, TillDate, Always.

    Bye
     

    nissse

    Portal Member
    September 27, 2006
    15
    0
    45
    Home Country
    Sweden Sweden
    My tv3 server crash when the hdd is full so Im realy looking forward to get this fix

    good luck and
    Thx alot
     

    Users who are viewing this thread

    Top Bottom