[vlma-devel] commit: Display medias which have the same frequency sorted by SID. ( Adrien Grand )
git version control
git at videolan.org
Sun Oct 26 09:19:42 CET 2008
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Sun Oct 26 08:56:36 2008 +0100| [cc2f29df74f79d9336e890565f6d75cacb3eedd5] | committer: Adrien Grand
Display medias which have the same frequency sorted by SID.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=cc2f29df74f79d9336e890565f6d75cacb3eedd5
---
.../web/media/dtt/DTTChannelListController.java | 5 ++++-
.../media/satellite/SatChannelListController.java | 6 +++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/vlma-webapp/src/main/java/org/videolan/vlma/web/media/dtt/DTTChannelListController.java b/vlma-webapp/src/main/java/org/videolan/vlma/web/media/dtt/DTTChannelListController.java
index 7d6c8aa..6bfddbd 100644
--- a/vlma-webapp/src/main/java/org/videolan/vlma/web/media/dtt/DTTChannelListController.java
+++ b/vlma-webapp/src/main/java/org/videolan/vlma/web/media/dtt/DTTChannelListController.java
@@ -52,7 +52,10 @@ public class DTTChannelListController implements Controller {
Comparator<DTTChannel> comparator = new Comparator<DTTChannel>() {
public int compare(DTTChannel o1, DTTChannel o2) {
- return o1.getFrequency() - o2.getFrequency();
+ int result = o1.getFrequency() - o2.getFrequency();
+ if(result == 0)
+ result = o1.getSid() - o2.getSid();
+ return result;
}
};
diff --git a/vlma-webapp/src/main/java/org/videolan/vlma/web/media/satellite/SatChannelListController.java b/vlma-webapp/src/main/java/org/videolan/vlma/web/media/satellite/SatChannelListController.java
index d98c75a..e1eed15 100644
--- a/vlma-webapp/src/main/java/org/videolan/vlma/web/media/satellite/SatChannelListController.java
+++ b/vlma-webapp/src/main/java/org/videolan/vlma/web/media/satellite/SatChannelListController.java
@@ -56,7 +56,11 @@ public class SatChannelListController implements Controller {
Comparator<SatChannel> comparator = new Comparator<SatChannel>() {
public int compare(SatChannel o1, SatChannel o2) {
- return o1.getFrequency() - o2.getFrequency();
+ int result = o1.getFrequency() - o2.getFrequency();
+ if(result == 0) {
+ result = o1.getSid() - o2.getSid();
+ }
+ return result;
}
};
More information about the vlma-devel
mailing list