Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
9a6ee723
Commit
9a6ee723
authored
Nov 20, 2006
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filters '/' characters in tags, to create valid filenames
parent
d223913f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
src/input/meta.c
src/input/meta.c
+26
-4
No files found.
src/input/meta.c
View file @
9a6ee723
...
...
@@ -182,18 +182,36 @@ int input_DownloadAndCacheArt( playlist_t *p_playlist, input_item_t *p_item )
int
i_status
=
VLC_EGENERIC
;
stream_t
*
p_stream
;
char
psz_filename
[
MAX_PATH
+
1
],
psz_dir
[
MAX_PATH
+
1
];
char
*
psz_artist
;
char
*
psz_album
;
char
*
psz_artist
=
NULL
;
char
*
psz_album
=
NULL
;
char
*
psz_type
;
psz_artist
=
p_item
->
p_meta
->
psz_artist
;
psz_album
=
p_item
->
p_meta
->
psz_album
;
int
i
;
if
(
p_item
->
p_meta
->
psz_artist
)
psz_artist
=
strdup
(
p_item
->
p_meta
->
psz_artist
);
if
(
p_item
->
p_meta
->
psz_album
)
psz_album
=
strdup
(
p_item
->
p_meta
->
psz_album
);
assert
(
p_item
->
p_meta
&&
!
EMPTY_STR
(
p_item
->
p_meta
->
psz_arturl
)
);
/* FIXME: use an alternate saving filename scheme if we don't have
* the artist or album name */
if
(
!
p_item
->
p_meta
->
psz_artist
||
!
p_item
->
p_meta
->
psz_album
)
{
free
(
psz_artist
);
free
(
psz_album
);
return
VLC_EGENERIC
;
}
/* Doesn't create a filename with invalid characters
* TODO: several filesystems forbid several characters: list them all
*/
for
(
i
=
0
;
i
<
strlen
(
psz_artist
)
;
i
++
)
if
(
psz_artist
[
i
]
==
'/'
)
psz_artist
[
i
]
=
' '
;
for
(
i
=
0
;
i
<
strlen
(
psz_album
)
;
i
++
)
if
(
psz_album
[
i
]
==
'/'
)
psz_album
[
i
]
=
' '
;
psz_type
=
strrchr
(
p_item
->
p_meta
->
psz_arturl
,
'.'
);
...
...
@@ -223,6 +241,8 @@ int input_DownloadAndCacheArt( playlist_t *p_playlist, input_item_t *p_item )
if
(
!
strncmp
(
p_item
->
p_meta
->
psz_arturl
,
"APIC"
,
4
)
)
{
msg_Warn
(
p_playlist
,
"APIC fetch not supported yet"
);
free
(
psz_artist
);
free
(
psz_album
);
return
VLC_EGENERIC
;
}
...
...
@@ -244,6 +264,8 @@ int input_DownloadAndCacheArt( playlist_t *p_playlist, input_item_t *p_item )
p_item
->
p_meta
->
psz_arturl
=
strdup
(
psz_filename
);
i_status
=
VLC_SUCCESS
;
}
free
(
psz_artist
);
free
(
psz_album
);
return
i_status
;
}
...
...
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