[Feedback Wanted] Issue with ISOs in "Online (Folder)"
Posted: Sun Jun 28, 2020 10:11 am
It's amazing to me that after 3 years of developing CMC, I'm still coming across little My Movies integration issues and challenges that need a solution. I blame MM, which has just waaaaaay too many ways to input data based upon user whim.
So I writing this post looking for user feedback. I know this post is long, but the act of writing this all out actually helps me think through the issue and come up with solutions. I think towards the end here I have posted a viable solution, though I welcome all user feedback on the issue and your own use cases, plus any alternative solutions you can dream up.
My Current Challenge
Yesterday I was watching Dexter Season 2 which I have on ISO. Earlier in the day I had watched episode 1, and the ISO mounted fine. Afterwards I had performed a SmartSync, and then later tried to watch episode 2, and the ISO would not mount with Virtual CloneDrive. Troubleshooting the issue, I finally discovered that the Disc Location in CMC was pointing to an Online (Folder) (\\Tower\TV_Series\Dexter\Dexter Season 2\), which happens to have all 3 of the Season 2 disc ISO's in the same folder, and CMC was trying to mount the folder itself as an ISO, instead of mounting a specific ISO file. Obviously, VCD can't mount folders, only ISO files.
I did a Full Sync and the problem was resolved... temporarily. CMC now had the full path to the ISO (\\Tower\TV_Series\Dexter\Dexter Season 2\DEXTER SEASON 2 D1.iso). But any xml metadata updates that cause the SmartSync to process this title again brings the problem back. This is because I have Disc 1 Location configured as an Online (Folder) in MMCM, and Discs 2 & 3 as Online (File) pointing at their respective ISO disc files. When CMC's SmartSync processes the update, it is overwriting the previous Disc 1 ISO file path (that CMC discovered during the Full Sync) with the current Online (Folder) path in the XML metadata.
I consider this a bug in CMC's SmartSync, and a solvable one at that, so I'm not looking for feedback on this aspect of the issue. But taking a step back and looking at the big picture, I realized the problem is actually much bigger.
The Real Issue
This simple SmartSync bug has brought a new issue to light for me. As many of you know, I am working on an enhanced version of CME that skips exporting metadata files, and instead directly writes data to the CMC database. While this sounds simple and easy, there is a huge problem with ISO's configured in My Movies as an "Online (Folder)", as the metadata does not include the ISO filename needed to mount the ISO.
The problem does not exist with CMC today because CMC's Sync routine scans every media folder looking for playable media. When the Sync finds the ISO file, it then finds a mymovies.xml/mmTitle.xml file to go with it. And for an ISO configured as an Online (Folder) in MMCM, CMC overrides the folder path in the XML metadata, replacing it with the actual ISO file path that it discovered during the Sync. This is one of the many benefits of the current Sync process - CMC finds your playable media even if it is missing in MMCM.
But without the current Sync process, the only data that CMC would have about the filepath is the MMCM data, which indicates that a title is an "Online (Folder)" and doesn't actually point to any particular ISO file. So in the future, when CME grabs the metadata from the My Movies API and directly writes the CMC database, all ISO based titles configured as Online (Folder) will only point to a folder, and not a particular ISO file in the folder, which in turn breaks in CMC because you can't mount a folder using Virtual CloneDrive.
Why not use "Online (File)" in MMCM?
Now, you might be thinking that the simple answer is to configure all ISO's as "Online (Files)", and a year ago I would have agreed with you. But not anymore.
Last year I started reconfiguring my ISO's as Online (File) in My Movies Collection Management. At first, this solution seemed to work perfectly. But after a while I started noticing a title duplication issue in My Movies. The duplication issue was random, often taking months before it would happen. And when it happened, the duplicate title was always an "Online (Folder)" pointing to the same directory as the "Online (File)" ISO, and the duplicate title would have a different barcode.
I finally realized that My Movies Folder Monitoring was the problem. My best guess is that Folder Monitoring is always trying to add an Online (Folder) for every media folder it discovers an ISO inside, but as long as the newly identified title had the same barcode as an existing title in my collection (the Online File based title), then it wouldn't re-add or change the title.
But as soon as someone contributed a new version of that title to the online service, with a different barcode, then Folder Monitoring would change its mind and decide that the Online (Folder) was for this other barcoded version of the same movie title, and then I would have a duplicate copy of the movie, only with a different barcode and configured as an Online (Folder).
It was quite obvious when this had happened. For example, I added the movie Hanna to my collection a decade ago, yet last week while working in MMCM and sorting by Collection Number, my newest title was Hanna. That immediately struck me as odd, and sorting alphabetically I found I now had two copies of Hanna, with different barcodes, the original an "Online (File)" I added all those years ago, and the second an "Online (Folder)" that had just been added by Folder Monitoring.
Apparently MMCM Folder Monitoring is not smart enough to realize that movie already exists in my collection as an Online (File) configured title. The only way to prevent this fiasco is to configure all ISO's as Online Folders. Last week, I updated all of my Online (File) movies to be Online (Folder) instead. Online (Folder) also seems to be a "best practice" according to Binnerup's guidance on the My Movies forums, so I feel doubly justified in using Online (Folder) for my ISO's.
I also have to consider that since My Movies allows users to configure an ISO as an Online (Folder), other users will do this, and for that reason I have to support this configuration in CMC, even though it poses a challenge to mounting the unidentified ISO file.
How to Mount an Online Folder
Which brings us full circle back to the issue at hand. When you configure an ISO as an Online (Folder) in My Movies, the My Movies metadata only has the folder path without the ISO's filename.
A potential solution is for me to enhance CMC's playback routine, so that when it is starting playback of an Online Folder, that it actually scans the target directory to determine if it is a DVD folder rip, or alternatively an ISO file that needs to be mounted. Hopefully this won't add too much time to the mounting process - that's always a concern for me - but this is a necessary step to account for the lack of clarity in the My Movies metadata.
The problem, then, is what do I do in a directory such as the Dexter Season 2 screenshot above, where I have 3 ISO's residing in the same folder? I could grab the first ISO filename alphabetically, and that might work most of the time, but there is still a potential issue with this approach.
I recently added all 9 seasons of The Office (US) to my collection. One of the things I noticed is that the disc names are not consistent. Sometimes the disc name is something like "THE_OFFICE_S9_D1", and sometimes it is missing the "THE_" prefix, i.e. "OFFICE_S9_D2". When sorting alphabetically, "OFFICE_S9_D2" comes before "THE_OFFICE_S9_D1". So I think I need a more robust solution.
I suppose I could make the disc mounting routine even smarter, that instead of just grabbing the first ISO filename alphabetically, it would instead grab the first ISO filename alphabetically that was not also configured as an Online (File) for another disc (which is exactly what I have done for Dexter). That would mean additional processing in CMC to double-check the list of configured discs looking to make sure it was grabbing an unlisted ISO, though I have come to learn that this type of computational processing is surprisingly quick so I don't think it would take much time to perform this analysis.
Your Thoughts and Ideas
All of this has my head spinning a little - maybe yours too. I keep thinking back to Windows Media Center with the My Movies plugin. Though it has been years since I have used WMC, I seem to recall that you could play ISO's that had been configured as Online (Folder). In fact, I'm almost sure of it, because before I wrote CMC I believe 99.9% of all my titles were ISO's configured as Online Folders. I had never done anything different until CMC users reported issues with CMC on their collection and they explained they didn't use ISO's or Online Folders, which got me to try these other methods as well.
Which has me wondering, how did My Movies handle this mounting issue? Obviously, My Movies discovered the ISO files in my media folders during the Folder Monitoring, but even though it knew the ISO filenames, it seems like it throws this data away for Online Folders, as the exported metadata only includes the folder name, and not the ISO filename. It seems a bit silly to throw that data away, and to have to rescan the directory to see if there is an ISO to be mounted for playback, so I'm not sure if My Movies secretly kept the ISO filename internally to use for mounting, or if it really did have to rescan each time looking for what to play and how to play it. Probably the answer on how WMC did this is irrelevant, since the My Movies API doesn't export the filename regardless, so I don't think I have other options at my disposal.
What are your experiences and recollections with how My Movies on WMC handled this?
Do you think the approach I suggested above will work?
Do you have other use cases that I need to consider?
Along the lines of that last question, I have this concern: There is another Location option in MMCM for discs, "Online (Folder Content)". I've never actually used this option, but it's been in the back of my mind ever since I read a post by Binnerup regarding "Online (Folder Content)" being the solution for an Online Folder that has multiple media files in it:
Perhaps that is how I should have configured my Dexter Season 2. Does anyone here ever use "Online (Folder Content)"? I'm guessing no, because I think CMC would break in this scenario, but since I haven't tried it myself I really don't know.
Alright, that's more than enough writing. Sorry for the long post...
Paul
So I writing this post looking for user feedback. I know this post is long, but the act of writing this all out actually helps me think through the issue and come up with solutions. I think towards the end here I have posted a viable solution, though I welcome all user feedback on the issue and your own use cases, plus any alternative solutions you can dream up.
My Current Challenge
Yesterday I was watching Dexter Season 2 which I have on ISO. Earlier in the day I had watched episode 1, and the ISO mounted fine. Afterwards I had performed a SmartSync, and then later tried to watch episode 2, and the ISO would not mount with Virtual CloneDrive. Troubleshooting the issue, I finally discovered that the Disc Location in CMC was pointing to an Online (Folder) (\\Tower\TV_Series\Dexter\Dexter Season 2\), which happens to have all 3 of the Season 2 disc ISO's in the same folder, and CMC was trying to mount the folder itself as an ISO, instead of mounting a specific ISO file. Obviously, VCD can't mount folders, only ISO files.
I did a Full Sync and the problem was resolved... temporarily. CMC now had the full path to the ISO (\\Tower\TV_Series\Dexter\Dexter Season 2\DEXTER SEASON 2 D1.iso). But any xml metadata updates that cause the SmartSync to process this title again brings the problem back. This is because I have Disc 1 Location configured as an Online (Folder) in MMCM, and Discs 2 & 3 as Online (File) pointing at their respective ISO disc files. When CMC's SmartSync processes the update, it is overwriting the previous Disc 1 ISO file path (that CMC discovered during the Full Sync) with the current Online (Folder) path in the XML metadata.
I consider this a bug in CMC's SmartSync, and a solvable one at that, so I'm not looking for feedback on this aspect of the issue. But taking a step back and looking at the big picture, I realized the problem is actually much bigger.
The Real Issue
This simple SmartSync bug has brought a new issue to light for me. As many of you know, I am working on an enhanced version of CME that skips exporting metadata files, and instead directly writes data to the CMC database. While this sounds simple and easy, there is a huge problem with ISO's configured in My Movies as an "Online (Folder)", as the metadata does not include the ISO filename needed to mount the ISO.
The problem does not exist with CMC today because CMC's Sync routine scans every media folder looking for playable media. When the Sync finds the ISO file, it then finds a mymovies.xml/mmTitle.xml file to go with it. And for an ISO configured as an Online (Folder) in MMCM, CMC overrides the folder path in the XML metadata, replacing it with the actual ISO file path that it discovered during the Sync. This is one of the many benefits of the current Sync process - CMC finds your playable media even if it is missing in MMCM.
But without the current Sync process, the only data that CMC would have about the filepath is the MMCM data, which indicates that a title is an "Online (Folder)" and doesn't actually point to any particular ISO file. So in the future, when CME grabs the metadata from the My Movies API and directly writes the CMC database, all ISO based titles configured as Online (Folder) will only point to a folder, and not a particular ISO file in the folder, which in turn breaks in CMC because you can't mount a folder using Virtual CloneDrive.
Why not use "Online (File)" in MMCM?
Now, you might be thinking that the simple answer is to configure all ISO's as "Online (Files)", and a year ago I would have agreed with you. But not anymore.
Last year I started reconfiguring my ISO's as Online (File) in My Movies Collection Management. At first, this solution seemed to work perfectly. But after a while I started noticing a title duplication issue in My Movies. The duplication issue was random, often taking months before it would happen. And when it happened, the duplicate title was always an "Online (Folder)" pointing to the same directory as the "Online (File)" ISO, and the duplicate title would have a different barcode.
I finally realized that My Movies Folder Monitoring was the problem. My best guess is that Folder Monitoring is always trying to add an Online (Folder) for every media folder it discovers an ISO inside, but as long as the newly identified title had the same barcode as an existing title in my collection (the Online File based title), then it wouldn't re-add or change the title.
But as soon as someone contributed a new version of that title to the online service, with a different barcode, then Folder Monitoring would change its mind and decide that the Online (Folder) was for this other barcoded version of the same movie title, and then I would have a duplicate copy of the movie, only with a different barcode and configured as an Online (Folder).
It was quite obvious when this had happened. For example, I added the movie Hanna to my collection a decade ago, yet last week while working in MMCM and sorting by Collection Number, my newest title was Hanna. That immediately struck me as odd, and sorting alphabetically I found I now had two copies of Hanna, with different barcodes, the original an "Online (File)" I added all those years ago, and the second an "Online (Folder)" that had just been added by Folder Monitoring.
Apparently MMCM Folder Monitoring is not smart enough to realize that movie already exists in my collection as an Online (File) configured title. The only way to prevent this fiasco is to configure all ISO's as Online Folders. Last week, I updated all of my Online (File) movies to be Online (Folder) instead. Online (Folder) also seems to be a "best practice" according to Binnerup's guidance on the My Movies forums, so I feel doubly justified in using Online (Folder) for my ISO's.
I also have to consider that since My Movies allows users to configure an ISO as an Online (Folder), other users will do this, and for that reason I have to support this configuration in CMC, even though it poses a challenge to mounting the unidentified ISO file.
How to Mount an Online Folder
Which brings us full circle back to the issue at hand. When you configure an ISO as an Online (Folder) in My Movies, the My Movies metadata only has the folder path without the ISO's filename.
A potential solution is for me to enhance CMC's playback routine, so that when it is starting playback of an Online Folder, that it actually scans the target directory to determine if it is a DVD folder rip, or alternatively an ISO file that needs to be mounted. Hopefully this won't add too much time to the mounting process - that's always a concern for me - but this is a necessary step to account for the lack of clarity in the My Movies metadata.
The problem, then, is what do I do in a directory such as the Dexter Season 2 screenshot above, where I have 3 ISO's residing in the same folder? I could grab the first ISO filename alphabetically, and that might work most of the time, but there is still a potential issue with this approach.
I recently added all 9 seasons of The Office (US) to my collection. One of the things I noticed is that the disc names are not consistent. Sometimes the disc name is something like "THE_OFFICE_S9_D1", and sometimes it is missing the "THE_" prefix, i.e. "OFFICE_S9_D2". When sorting alphabetically, "OFFICE_S9_D2" comes before "THE_OFFICE_S9_D1". So I think I need a more robust solution.
I suppose I could make the disc mounting routine even smarter, that instead of just grabbing the first ISO filename alphabetically, it would instead grab the first ISO filename alphabetically that was not also configured as an Online (File) for another disc (which is exactly what I have done for Dexter). That would mean additional processing in CMC to double-check the list of configured discs looking to make sure it was grabbing an unlisted ISO, though I have come to learn that this type of computational processing is surprisingly quick so I don't think it would take much time to perform this analysis.
Your Thoughts and Ideas
All of this has my head spinning a little - maybe yours too. I keep thinking back to Windows Media Center with the My Movies plugin. Though it has been years since I have used WMC, I seem to recall that you could play ISO's that had been configured as Online (Folder). In fact, I'm almost sure of it, because before I wrote CMC I believe 99.9% of all my titles were ISO's configured as Online Folders. I had never done anything different until CMC users reported issues with CMC on their collection and they explained they didn't use ISO's or Online Folders, which got me to try these other methods as well.
Which has me wondering, how did My Movies handle this mounting issue? Obviously, My Movies discovered the ISO files in my media folders during the Folder Monitoring, but even though it knew the ISO filenames, it seems like it throws this data away for Online Folders, as the exported metadata only includes the folder name, and not the ISO filename. It seems a bit silly to throw that data away, and to have to rescan the directory to see if there is an ISO to be mounted for playback, so I'm not sure if My Movies secretly kept the ISO filename internally to use for mounting, or if it really did have to rescan each time looking for what to play and how to play it. Probably the answer on how WMC did this is irrelevant, since the My Movies API doesn't export the filename regardless, so I don't think I have other options at my disposal.
What are your experiences and recollections with how My Movies on WMC handled this?
Do you think the approach I suggested above will work?
Do you have other use cases that I need to consider?
Along the lines of that last question, I have this concern: There is another Location option in MMCM for discs, "Online (Folder Content)". I've never actually used this option, but it's been in the back of my mind ever since I read a post by Binnerup regarding "Online (Folder Content)" being the solution for an Online Folder that has multiple media files in it:
Perhaps that is how I should have configured my Dexter Season 2. Does anyone here ever use "Online (Folder Content)"? I'm guessing no, because I think CMC would break in this scenario, but since I haven't tried it myself I really don't know.
Alright, that's more than enough writing. Sorry for the long post...
Paul