Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
60c077c7
Commit
60c077c7
authored
Aug 24, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/Settings: add function IsTagEnabled() wrapping access to ignore_tag_items[]
parent
7aaa4dda
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
5 deletions
+24
-5
TagPrint.cxx
src/TagPrint.cxx
+1
-1
DatabaseSave.cxx
src/db/plugins/simple/DatabaseSave.cxx
+2
-2
Set.cxx
src/tag/Set.cxx
+1
-1
TagBuilder.cxx
src/tag/TagBuilder.cxx
+1
-1
TagSettings.h
src/tag/TagSettings.h
+19
-0
No files found.
src/TagPrint.cxx
View file @
60c077c7
...
...
@@ -27,7 +27,7 @@ void
tag_print_types
(
Response
&
r
)
{
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
i
++
)
if
(
!
ignore_tag_items
[
i
]
)
if
(
IsTagEnabled
(
i
)
)
r
.
Format
(
"tagtype: %s
\n
"
,
tag_item_names
[
i
]);
}
...
...
src/db/plugins/simple/DatabaseSave.cxx
View file @
60c077c7
...
...
@@ -58,7 +58,7 @@ db_save_internal(BufferedOutputStream &os, const Directory &music_root)
os
.
Format
(
"%s%s
\n
"
,
DIRECTORY_FS_CHARSET
,
GetFSCharset
());
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
if
(
!
ignore_tag_items
[
i
]
)
if
(
IsTagEnabled
(
i
)
)
os
.
Format
(
DB_TAG_PREFIX
"%s
\n
"
,
tag_item_names
[
i
]);
os
.
Format
(
"%s
\n
"
,
DIRECTORY_INFO_END
);
...
...
@@ -142,7 +142,7 @@ db_load_internal(TextFile &file, Directory &music_root, Error &error)
}
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
{
if
(
!
ignore_tag_items
[
i
]
&&
!
tags
[
i
])
{
if
(
IsTagEnabled
(
i
)
&&
!
tags
[
i
])
{
error
.
Set
(
db_domain
,
"Tag list mismatch, "
"discarding database file"
);
...
...
src/tag/Set.cxx
View file @
60c077c7
...
...
@@ -110,7 +110,7 @@ TagSet::InsertUnique(const Tag &tag,
if
(
!
CheckUnique
(
type
,
tag
,
type
,
group_mask
)
&&
(
type
!=
TAG_ALBUM_ARTIST
||
ignore_tag_items
[
TAG_ALBUM_ARTIST
]
||
!
IsTagEnabled
(
TAG_ALBUM_ARTIST
)
||
/* fall back to "Artist" if no "AlbumArtist" was found */
!
CheckUnique
(
type
,
tag
,
TAG_ARTIST
,
group_mask
)))
InsertUnique
(
tag
,
type
,
nullptr
,
group_mask
);
...
...
src/tag/TagBuilder.cxx
View file @
60c077c7
...
...
@@ -220,7 +220,7 @@ TagBuilder::AddItem(TagType type, const char *value, size_t length)
assert
(
value
!=
nullptr
);
#endif
if
(
length
==
0
||
ignore_tag_items
[
type
]
)
if
(
length
==
0
||
!
IsTagEnabled
(
type
)
)
return
;
AddItemInternal
(
type
,
value
,
length
);
...
...
src/tag/TagSettings.h
View file @
60c077c7
...
...
@@ -21,9 +21,28 @@
#define MPD_TAG_SETTINGS_H
#include "TagType.h"
#include "Compiler.h"
#include <stdbool.h>
extern
bool
ignore_tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
#ifdef __cplusplus
gcc_const
static
inline
bool
IsTagEnabled
(
unsigned
tag
)
{
return
!
ignore_tag_items
[
tag
];
}
gcc_const
static
inline
bool
IsTagEnabled
(
TagType
tag
)
{
return
IsTagEnabled
(
unsigned
(
tag
));
}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment