Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
medialibrary
Manage
Activity
Members
Labels
Plan
Issues
75
Issue boards
Milestones
Wiki
Code
Merge requests
9
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
medialibrary
Merge requests
!8
Playlist rc6
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Playlist rc6
Nerf/medialibrary:playlist-rc6
into
master
Overview
7
Commits
9
Pipelines
0
Changes
20
Closed
Alexandre Fernandez
requested to merge
Nerf/medialibrary:playlist-rc6
into
master
7 years ago
Overview
7
Commits
9
Pipelines
0
Changes
20
Expand
Should correct all points raised in RC5
0
0
Merge request reports
Compare
master
version 2
3bee0da5
7 years ago
version 1
1c72508c
7 years ago
master (base)
and
latest version
latest version
441b2ad2
9 commits,
7 years ago
version 2
3bee0da5
10 commits,
7 years ago
version 1
1c72508c
10 commits,
7 years ago
20 files
+
694
−
59
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
20
Search (e.g. *.vue) (Ctrl+P)
src/discoverer/probe/CrawlerProbe.h
0 → 100644
+
109
−
0
Options
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2017 Hugo Beauzée-Luyssen, Videolabs
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Alexandre Fernandez <nerf@boboop.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include
"discoverer/probe/IProbe.h"
namespace
medialibrary
{
namespace
prober
{
class
CrawlerProbe
:
public
IProbe
{
public:
CrawlerProbe
()
=
default
;
void
setDiscoverNoMedia
(
bool
discoverNoMedia
)
{
m_discoverNoMedia
=
discoverNoMedia
;
}
virtual
bool
proceedOnDirectory
(
const
fs
::
IDirectory
&
)
override
{
return
true
;
}
virtual
bool
isHidden
(
const
fs
::
IDirectory
&
directory
)
override
{
bool
hidden
=
m_discoverNoMedia
==
false
&&
hasDotNoMediaFile
(
directory
)
==
true
;
if
(
hidden
==
true
)
LOG_INFO
(
"Ignoring folder "
,
directory
.
mrl
(),
" with a .nomedia file"
);
return
hidden
;
}
virtual
bool
proceedOnFile
(
const
fs
::
IFile
&
)
override
{
return
true
;
}
virtual
bool
stopFileDiscovery
()
override
{
return
false
;
}
virtual
bool
deleteUnseenFolders
()
override
{
return
true
;
}
virtual
bool
deleteUnseenFiles
()
override
{
return
true
;
}
virtual
bool
forceFileRefresh
()
override
{
return
false
;
}
virtual
std
::
shared_ptr
<
Folder
>
getFolderParent
()
override
{
return
nullptr
;
}
virtual
std
::
pair
<
std
::
shared_ptr
<
Playlist
>
,
unsigned
int
>
getPlaylistParent
()
override
{
return
{
nullptr
,
0
};
}
private
:
static
bool
hasDotNoMediaFile
(
const
fs
::
IDirectory
&
directory
)
{
const
auto
&
files
=
directory
.
files
();
return
std
::
find_if
(
begin
(
files
),
end
(
files
),
[](
const
std
::
shared_ptr
<
fs
::
IFile
>&
file
){
return
strcasecmp
(
file
->
name
().
c_str
(),
".nomedia"
)
==
0
;
})
!=
end
(
files
);
}
private
:
bool
m_discoverNoMedia
;
// Initialized to false
};
}
}
Loading