Adding artist/release/track max name length checks. NOT TESTED
This commit is contained in:
@@ -21,11 +21,9 @@
|
||||
- Implement a video database cleanup
|
||||
- Group video in "video groups". Each video may has sub groups (current "Path" class)
|
||||
-> Simplify database and remove the Path class
|
||||
- Use size limits for strings (artist, release, genre)?
|
||||
- Process only files whose extensions are well known in audio/video world (avoid useless parsing/errors)?
|
||||
|
||||
[Metadata]
|
||||
- Skip trailing non printable characters (spaces) in track name, artist, etc.
|
||||
|
||||
[Transcode]
|
||||
- some zombies seem to be remaining after a week of use
|
||||
@@ -43,20 +41,20 @@
|
||||
- Prefered codecs for audio/video?
|
||||
|
||||
[Audio]
|
||||
- Search patterns in the genre list
|
||||
- ReleaseView/ArtistView/GenreView: <All> -> Track count for this special category. Easier: add a special entry '<All>' that contains everything?
|
||||
- MediaPlayer: move slider using js (http://redmine.webtoolkit.eu/boards/2/topics/7924?r=8478)
|
||||
- TrackView : handle original release date
|
||||
- TrackView : handle duration > 1 hour
|
||||
- TrackView : select only relevant columns to speed up queries (do not get eveything)
|
||||
- TrackView : Reselect the current selected item when displaying the updated search results
|
||||
- ReleaseView: display the release's publication year
|
||||
- ReleaseView: display the original release's publication year
|
||||
- OGG metadata -> properly handle metadata nested in the audio stream
|
||||
- TrackView : when udating the view, reselect the current playing track
|
||||
- Filters: use directly the id as constraint, instead of the name?
|
||||
- Implement a playlist:
|
||||
- Drag and drop all objets from the views (genre, artist, release, track) in the playlist?
|
||||
- Add 'play/add last' button on mouse hover?
|
||||
- Save/Load playlists?
|
||||
- Drag and drop all objets from the views (genre, artist, release, track) in the playlist?
|
||||
- Add 'play/add last' button on mouse hover?
|
||||
- Save/Load playlists?
|
||||
|
||||
[Video]
|
||||
- View the Videos in a WtTableView ?
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ namespace Database
|
||||
{
|
||||
|
||||
Artist::Artist(const std::string& name)
|
||||
: _name(name)
|
||||
: _name(std::string(name, 0 , _maxNameLength))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ Artist::Artist(const std::string& name)
|
||||
Artist::pointer
|
||||
Artist::getByName(Wt::Dbo::Session& session, const std::string& name)
|
||||
{
|
||||
return session.find<Artist>().where("name = ?").bind( name );
|
||||
return session.find<Artist>().where("name = ?").bind( std::string(name, 0, _maxNameLength) );
|
||||
}
|
||||
|
||||
// Create
|
||||
|
||||
@@ -51,6 +51,9 @@ class Artist
|
||||
|
||||
|
||||
private:
|
||||
|
||||
static const std::size_t _maxNameLength = 128;
|
||||
|
||||
std::string _name;
|
||||
|
||||
Wt::Dbo::collection< Wt::Dbo::ptr<Track> > _tracks; // Tracks of this artist
|
||||
@@ -93,6 +96,7 @@ class Release
|
||||
}
|
||||
|
||||
private:
|
||||
static const std::size_t _maxNameLength = 128;
|
||||
std::string _name;
|
||||
|
||||
Wt::Dbo::collection< Wt::Dbo::ptr<Track> > _tracks; // Tracks in the release
|
||||
@@ -130,6 +134,7 @@ class Genre
|
||||
}
|
||||
|
||||
private:
|
||||
static const std::size_t _maxNameLength = 128;
|
||||
std::string _name;
|
||||
|
||||
Wt::Dbo::collection< Wt::Dbo::ptr<Track> > _tracks;
|
||||
@@ -161,7 +166,7 @@ class Track
|
||||
// Accessors
|
||||
void setTrackNumber(int num) { _trackNumber = num; }
|
||||
void setDiscNumber(int num) { _discNumber = num; }
|
||||
void setName(const std::string& name) { _name = name; }
|
||||
void setName(const std::string& name) { _name = std::string(name, 0, _maxNameLength); }
|
||||
void setDuration(boost::posix_time::time_duration duration) { _duration = duration; }
|
||||
void setLastWriteTime(boost::posix_time::ptime time) { _fileLastWrite = time; }
|
||||
void setChecksum(const std::vector<unsigned char>& checksum) { _fileChecksum = checksum; }
|
||||
@@ -203,6 +208,9 @@ class Track
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static const std::size_t _maxNameLength = 128;
|
||||
|
||||
int _trackNumber;
|
||||
int _discNumber;
|
||||
std::string _name;
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ Genre::Genre()
|
||||
}
|
||||
|
||||
Genre::Genre(const std::string& name)
|
||||
: _name( name )
|
||||
: _name( std::string(name, 0, _maxNameLength) )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ Genre::pointer
|
||||
Genre::getByName(Wt::Dbo::Session& session, const std::string& name)
|
||||
{
|
||||
// TODO use like search
|
||||
return session.find<Genre>().where("name = ?").bind( name );
|
||||
return session.find<Genre>().where("name = ?").bind( std::string(name, 0, _maxNameLength) );
|
||||
}
|
||||
|
||||
Genre::pointer
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
namespace Database {
|
||||
|
||||
Release::Release(const std::string& name)
|
||||
: _name(name)
|
||||
: _name(std::string(name, 0, _maxNameLength))
|
||||
{
|
||||
}
|
||||
|
||||
Release::pointer
|
||||
Release::getByName(Wt::Dbo::Session& session, const std::string& name)
|
||||
{
|
||||
return session.find<Release>().where("name = ?").bind( name );
|
||||
return session.find<Release>().where("name = ?").bind( std::string(name, 0, _maxNameLength) );
|
||||
}
|
||||
|
||||
Release::pointer
|
||||
|
||||
Reference in New Issue
Block a user