2 * Copyright (C) 2017-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
8 // LibExportSettings.cpp: implementation of the CLibExportSettings class.
10 //////////////////////////////////////////////////////////////////////
12 #include "LibExportSettings.h"
14 //////////////////////////////////////////////////////////////////////
15 // Construction/Destruction
16 //////////////////////////////////////////////////////////////////////
18 CLibExportSettings::CLibExportSettings()
20 m_exporttype
= ELIBEXPORT_SINGLEFILE
;
21 m_itemstoexport
= ELIBEXPORT_ALBUMS
+ ELIBEXPORT_ALBUMARTISTS
;
28 bool CLibExportSettings::operator!=(const CLibExportSettings
&right
) const
30 if (m_exporttype
!= right
.m_exporttype
)
32 if (m_strPath
!= right
.m_strPath
)
34 if (m_overwrite
!= right
.m_overwrite
)
36 if (m_itemstoexport
!= right
.m_itemstoexport
)
39 if (m_artwork
!= right
.m_artwork
)
41 if (m_unscraped
!= right
.m_unscraped
)
43 if (m_skipnfo
!= right
.m_skipnfo
)
49 bool CLibExportSettings::IsItemExported(ELIBEXPORTOPTIONS item
) const
51 return (m_itemstoexport
& item
);
54 bool CLibExportSettings::IsArtists() const
56 return (m_itemstoexport
& ELIBEXPORT_ALBUMARTISTS
) ||
57 (m_itemstoexport
& ELIBEXPORT_SONGARTISTS
) ||
58 (m_itemstoexport
& ELIBEXPORT_OTHERARTISTS
);
61 std::vector
<int> CLibExportSettings::GetExportItems() const
63 std::vector
<int> values
;
64 if (IsItemExported(ELIBEXPORT_ALBUMS
))
65 values
.emplace_back(ELIBEXPORT_ALBUMS
);
66 if (IsItemExported(ELIBEXPORT_ALBUMARTISTS
))
67 values
.emplace_back(ELIBEXPORT_ALBUMARTISTS
);
68 if (IsItemExported(ELIBEXPORT_SONGARTISTS
))
69 values
.emplace_back(ELIBEXPORT_SONGARTISTS
);
70 if (IsItemExported(ELIBEXPORT_OTHERARTISTS
))
71 values
.emplace_back(ELIBEXPORT_OTHERARTISTS
);
72 if (IsItemExported(ELIBEXPORT_ACTORTHUMBS
))
73 values
.emplace_back(ELIBEXPORT_ACTORTHUMBS
);
74 if (IsItemExported(ELIBEXPORT_SONGS
))
75 values
.emplace_back(ELIBEXPORT_SONGS
);
79 std::vector
<int> CLibExportSettings::GetLimitedItems(int items
) const
81 std::vector
<int> values
;
82 if (IsItemExported(ELIBEXPORT_ALBUMS
) && (items
& ELIBEXPORT_ALBUMS
))
83 values
.emplace_back(ELIBEXPORT_ALBUMS
);
84 if (IsItemExported(ELIBEXPORT_ALBUMARTISTS
) && (items
& ELIBEXPORT_ALBUMARTISTS
))
85 values
.emplace_back(ELIBEXPORT_ALBUMARTISTS
);
86 if (IsItemExported(ELIBEXPORT_SONGARTISTS
) && (items
& ELIBEXPORT_SONGARTISTS
))
87 values
.emplace_back(ELIBEXPORT_SONGARTISTS
);
88 if (IsItemExported(ELIBEXPORT_OTHERARTISTS
) && (items
& ELIBEXPORT_OTHERARTISTS
))
89 values
.emplace_back(ELIBEXPORT_OTHERARTISTS
);
90 if (IsItemExported(ELIBEXPORT_ACTORTHUMBS
) && (items
& ELIBEXPORT_ACTORTHUMBS
))
91 values
.emplace_back(ELIBEXPORT_ACTORTHUMBS
);
92 if (IsItemExported(ELIBEXPORT_SONGS
) && (items
& ELIBEXPORT_SONGS
))
93 values
.emplace_back(ELIBEXPORT_SONGS
);
97 bool CLibExportSettings::IsSingleFile() const
99 return (m_exporttype
== ELIBEXPORT_SINGLEFILE
);
102 bool CLibExportSettings::IsSeparateFiles() const
104 return (m_exporttype
== ELIBEXPORT_SEPARATEFILES
);
107 bool CLibExportSettings::IsToLibFolders() const
109 return (m_exporttype
== ELIBEXPORT_TOLIBRARYFOLDER
);
112 bool CLibExportSettings::IsArtistFoldersOnly() const
114 return (m_exporttype
== ELIBEXPORT_ARTISTFOLDERS
);