-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Video] Improve user experience when playing movies/episodes from Bluray ISO/BDMV. #24720
Conversation
7186c23
to
ae6c6dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only checked the code style and didn't check the actual functionality.
xbmc/FileItem.cpp
Outdated
else | ||
return GetDynPath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else | |
return GetDynPath(); | |
return GetDynPath(); |
Remove the else
so that the function returns a value on every path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
xbmc/FileItem.h
Outdated
@@ -142,6 +142,8 @@ class CFileItem : | |||
const std::string &GetDynPath() const; | |||
void SetDynPath(const std::string &path); | |||
|
|||
const std::string GetBlurayPath() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const std::string GetBlurayPath() const; | |
std::string GetBlurayPath() const; |
Please don't return by const value, see http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-return-const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
xbmc/windows/GUIMediaWindow.cpp
Outdated
const CFileItem& j = *i.get(); | ||
return j.IsZIP() || j.IsRAR() || j.m_bIsFolder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const CFileItem& j = *i.get(); | |
return j.IsZIP() || j.IsRAR() || j.m_bIsFolder; | |
return i->IsZIP() || i->IsRAR() || i->m_bIsFolder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
xbmc/windows/GUIMediaWindow.cpp
Outdated
return i.get()->GetVideoInfoTag()->m_basePath == | ||
j.get()->GetVideoInfoTag()->m_basePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return i.get()->GetVideoInfoTag()->m_basePath == | |
j.get()->GetVideoInfoTag()->m_basePath; | |
return i->GetVideoInfoTag()->m_basePath == | |
j->GetVideoInfoTag()->m_basePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
xbmc/windows/GUIMediaWindow.cpp
Outdated
return i.get()->GetVideoInfoTag()->m_basePath == | ||
item.get()->GetVideoInfoTag()->m_basePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return i.get()->GetVideoInfoTag()->m_basePath == | |
item.get()->GetVideoInfoTag()->m_basePath; | |
return i->GetVideoInfoTag()->m_basePath == | |
item->GetVideoInfoTag()->m_basePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks for the feedback. |
Please squash the rebase fixes, apply the formatting changes and I'll merge this 🙂 |
Brilliant, thanks. All done. Any chance we could get #24794 (folder stacks) in as well?? As that would provide a good base for me to finish off #24304 - as that will need tweaks once both the first two are in (especially for DVDs - the vast majority of the work for that is already done in #24997) as that would then mean those using discs have almost the same seamless experience as those using files. The only remaining work would be around movie versions (ie. handling two versions on one disc - which would need some work with @ksooo and @CrystalP). Edit - by as welll I mean after this one and I've reconfirmed that they play together nicely. Thanks |
More than happy to. Let me just finish on folder stacks as I've got my head around that (and I'll ask you to review that when done) and I'll come back to this. Thanks for your comments. |
std::string sql = PrepareSQL("UPDATE movie SET c22='%s', idFile=%i WHERE idMovie=%i", | ||
fileAndPath.c_str(), idFile, idMovie); | ||
m_pDS->exec(sql); | ||
sql = PrepareSQL("UPDATE videoversion SET idFile=%i WHERE idMedia=%i AND media_type='movie'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for noticing this late and after a fixup commit was just merged.
This line is wrong, it will update all versions/extra of the movie and break them. videoversion.idFile is the only link between a parent movie and its additional versions/extras.
This also breaks version artwork, which uses idFile as key in the art table.
What is the need to change the idFile?
While this function may do the correct thing for a standalone/parent movie, it won't work if you try to apply this to an additional version or an extra.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idFile is changed when the initial path to an ISO/BDMV is resolved to a bluray:// url by user selection. Off the top of my head I think I kept the original so it is not re-added when the directory changes and library is refreshed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that line doesn't work if there is more than one version - is triggers and exceptoin - idFile is a primary key so can't appear twice.
BeginTransaction();
std::string sql = PrepareSQL("UPDATE movie SET c22='%s', idFile=%i WHERE idMovie=%i",
fileAndPath.c_str(), idFile, idMovie);
m_pDS->exec(sql);
sql = PrepareSQL(
"UPDATE videoversion SET idFile=%i WHERE idFile=%i AND idMedia=%i AND media_type='movie'",
idFile, oldIdFile, idMovie);
m_pDS->exec(sql);
CommitTransaction();
sql = PrepareSQL(
"UPDATE art SET media_id=%i WHERE media_id=%i AND media_type='videoversion'",
idFile, oldIdFile);
m_pDS->exec(sql);
CommitTransaction();
Seems to do the trick - using two bluray ISOs as versions - playing each (so there is then an additional file entry for each as bluray://) - versions seem OK and independent still and artwork seems fine in the info dialog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That logic is OK to update the default version of the movie (though the videoversion and art update would be better located in a new SetFileForVideoAsset function). There is an extra CommitTransaction() to remove line 10.
I don't see how it could work fine for the non-default version of a movie. Let's say you have uhd bd iso of a movie as default version and the bd iso as secondary version, and you play the bd.
Modifying the movie record with the bd info would be wrong. Changing idFile changes the default version of the movie > not correct, Changing c22 (path?) seems wrong too - an official file structure hasn't been decided yet but it's unlikely that all versions of a movie will have to live in the same folder.
(to be verified, not related to version). Another potential problem with the idFile change could come from the library scanner / info refresh creating an additional copy of the movie in the library since there is no movie record matching the idFile of the file found by scan anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I hadn't realised that additional versions were removed from the movies database.
I have a couple of ideas and will generate another PR soon.
This is another attempt at #24277 using @rmrector's advice about the VFS.
Complements #24304.
When a movie/episode is played from an ISO/BDMV an additional file is added
files
table and this is linked to themovies
orepisodes
entry.I've also fixed the way Play from Here works (or didn't work) for ISOs/BDMVs - by properly removing duplicates.
It doesn't require any database changes (unlike the first attempt).
Description
Motivation and context
How has this been tested?
Locally
What is the effect on users?
Base
![image](https://private-user-images.githubusercontent.com/99039295/287468440-b77285f0-bf07-4ec5-a409-261d88032c2f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NTc5NDEsIm5iZiI6MTcxOTU1NzY0MSwicGF0aCI6Ii85OTAzOTI5NS8yODc0Njg0NDAtYjc3Mjg1ZjAtYmYwNy00ZWM1LWE0MDktMjYxZDg4MDMyYzJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDA2NTQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBiMWI1ZjRhZmZkOThjMDhjNjU1MmMyZTQ4NGMzNDEzMDdiNjA2NDc4YjgwOGEzNDYxNmFmZWVkNDRlZTRjOGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oSfjMZFtkVz685LqM1CTfFWMWEW_L5NmPVXES5UAKrU)
![image](https://private-user-images.githubusercontent.com/99039295/287468451-afb990be-1361-499f-9091-22e3b2884d50.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NTc5NDEsIm5iZiI6MTcxOTU1NzY0MSwicGF0aCI6Ii85OTAzOTI5NS8yODc0Njg0NTEtYWZiOTkwYmUtMTM2MS00OTlmLTkwOTEtMjJlM2IyODg0ZDUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDA2NTQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI5ZmI1ZTI2ZmU2YThiNjM0ODIxMjBiNDQzZjY0NDk5NTM0OWE4NmYyMzg5M2E3ZDM5YmRjYjAzNWZhZjAxODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vwtJ67bIvsF-HM6-G4NkBbgi3zyVUM3_Mn5UUvUFfLg)
Having just refreshed from scraper - no details shown and duration from scraper.
Before
![image](https://private-user-images.githubusercontent.com/99039295/287468475-f86b7744-ad27-4e7e-9e2a-36146781fc42.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk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YXRlPTIwMjQwNjI4VDA2NTQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE0NmU4YTg5ZmE5MDAyNDQ4ZGNjMTg2NGU3M2ZiYWM4ZWExYWRmZDkwNzE5YmVhMmNjMmNjNTNmMmMzZTZlMjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._guCw3iMgrXa3zE0x8JM2yGbv-dW07p0IZJuctsfAZA)
Having just watched episode 1 - the details for both Episodes 1 and 2 (both on first ISO) have changed.
After
![image](https://private-user-images.githubusercontent.com/99039295/287468550-741fa02e-287d-4199-bbd3-96a24fdb0a48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NTc5NDEsIm5iZiI6MTcxOTU1NzY0MSwicGF0aCI6Ii85OTAzOTI5NS8yODc0Njg1NTAtNzQxZmEwMmUtMjg3ZC00MTk5LWJiZDMtOTZhMjRmZGIwYTQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDA2NTQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRkNzMyOWVlZGY0YTJkNzc4N2MxODE0MjZmZmZjMWJmNjgxM2I1MDY1NWE0YTdhNGQxZWRiZDg3NWQzZTJiYTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.l4lJGA73GUN8G8Jodb4Oxr69D-Ur8dB1uPADws3x0RY)
![image](https://private-user-images.githubusercontent.com/99039295/287468621-e73ec7f0-f194-4e10-8fc6-838e19481bd8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NTc5NDEsIm5iZiI6MTcxOTU1NzY0MSwicGF0aCI6Ii85OTAzOTI5NS8yODc0Njg2MjEtZTczZWM3ZjAtZjE5NC00ZTEwLThmYzYtODM4ZTE5NDgxYmQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDA2NTQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZjMDkwNzQ5YmU3M2Y4M2Q3MmQ3MzMzZDBlYzZkZWM4NmQwYTM3Y2Q3MDdkYzdmMzYwZjcyYzUzNzljY2JmZWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.BguML8Hzls9_vg56j5JbSCq6qVP4UXIQ1xbybZsQc4M)
Having just watched episode 1 - only episode 1 has changed
Then watching episode 2 - only 2 has changed and 1 is preserved.
![image](https://private-user-images.githubusercontent.com/99039295/287468653-2e4d31d6-4b4b-4924-b207-b3a48a439048.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NTc5NDEsIm5i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VomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTczZDgwOTM1M2U4OWM2MTFiOGQxMzhiNjQwZmFiM2Y5ZmY5MTgzYTU2NDMzOGMzYjE3NDY2M2RhODRjZmEzNzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wz3oG-ge7ZuWa5hlB7Qh0RzywHGtVbXQFdFRiICqzlo)
Screenshots (if appropriate):
Types of change
Checklist: