-
-
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] Adjust the validations and messages in add version/extra #24477
Conversation
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.
Nothing serious.
I spotted some code fragments that look very similar. Maybe here is some potential to factor out something to get rid of duplicate code?
xbmc/video/VideoDatabase.cpp
Outdated
int CVideoDatabase::GetVideoVersionInfo(const std::string& fileNameAndPath, | ||
int& idFile, | ||
std::string& typeVideoVersion, | ||
int& idMedia, | ||
MediaType& mediaType, | ||
VideoAssetType& videoAssetType) | ||
CVideoAssetInfo CVideoDatabase::GetVideoVersionInfo(const std::string& filenameAndPath) |
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 you so much for this interface change.
xbmc/video/VideoManagerTypes.h
Outdated
public: | ||
int m_idFile{-1}; | ||
int m_assetTypeId{-1}; | ||
std::string m_assetTypeName; | ||
int m_idMedia{-1}; | ||
MediaType m_mediaType{MediaTypeNone}; | ||
VideoAssetType m_assetType{VideoAssetType::UNKNOWN}; |
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 consider a class with all members being public
not a good design. Either you make the new type a struct
(and name it SVideoAssetInfo
and remove m_
prefix from the members) or you provide proper getters and setters and make the members private.
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.
Yes good idea. the code guidelines don't require the S prefix for the struct name, but still want the m_ prefix for the members...
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.
Okay, we ofc should follow the code guidelines.
Yes that is intentional to facilitate a refactoring. Only few details vary. I may even add a commit to this PR for it. |
bc3df0d
to
33b4e7c
Compare
33b4e7c
to
2b30cb9
Compare
Suggestions applied, rebased + final commit to avoid losing extras when moving a movie into another one through Add > Browse files. Left the code merge between versions and extra dialogs for future PR, I need to recharge a bit, this was pretty complicated. |
@@ -55,7 +55,6 @@ bool CGUIDialogVideoManagerExtras::OnMessage(CGUIMessage& message) | |||
{ | |||
AddVideoExtra(); | |||
} | |||
break; |
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 would keep this break;
, although not having it does not cause any problems atm. But if another case gets added in the future, one can easily forget to reintroduce the break here.
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.
ok I didn't mean to remove it.
2b30cb9
to
9328355
Compare
comments + formatting applied. |
9328355
to
19e7d12
Compare
19e7d12
to
87a10cf
Compare
87a10cf
to
13c7f07
Compare
Added todo for future merge of add version and add extras logic |
13c7f07
to
48257fc
Compare
Stopped being used after PR xbmc#24477
Stopped being used after PR xbmc#24477
Description
Reviewed, refactored, added messages. clarified messages related to the addition of a version or extra from library or files.
Both Manage versions > Add and the popup for similar movie found on scan are taken care of.
Manage versions > Add can add from library, relatively straightforward, but can also add any video file, which can be in many situations and require lots of validations and cases (videos is unknown, video is in library and is an extra, video is in library and is a version - could be default version or secondary version of a movie with only one version or multiple).
The design would need to change with the addition of a new dialog to clarify what's happening in some of the situations and avoid some overly long and not so clear messages. Only so much can be done with the available dialogs and space available in a popup yesno / OK dialog.
Messages changes:
Addressed functionality gaps:
Future todo: the code for versions and extras was made very similar on purpose, it will be possible to group them in one function.
Motivation and context
Noticed some misleading messages and that code had to be reviewed.
How has this been tested?
all combinations of adding version or extra from:
What is the effect on users?
Better messages, error checking and handling of the addition.
Screenshots (if appropriate):
upcoming
Types of change
Checklist: